1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Allow subflow env-var list to resize with the dialog

This commit is contained in:
Nick O'Leary 2019-02-04 17:20:13 +00:00
parent 79fe7d684c
commit 1fe8b388a3
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 27 additions and 6 deletions

View File

@ -372,6 +372,16 @@ RED.nodes = (function() {
paletteLabel: function() { return RED.nodes.subflow(sf.id).name },
inputLabels: function(i) { return sf.inputLabels?sf.inputLabels[i]:null },
outputLabels: function(i) { return sf.outputLabels?sf.outputLabels[i]:null },
oneditresize: function(size) {
var rows = $("#dialog-form>div:not(.node-input-env-container-row)");
var height = size.height;
for (var i=0; i<rows.size(); i++) {
height -= $(rows[i]).outerHeight(true);
}
var editorRow = $("#dialog-form>div.node-input-env-container-row");
height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
$("#node-input-env-container").editableList('height',height-80);
},
set:{
module: "node-red"
}

View File

@ -543,20 +543,23 @@ RED.editor = (function() {
function buildEnvForm(container, node) {
var env_container = $('#node-input-env-container');
env_container
.css('min-height','250px').css('min-width','450px')
.css({
'min-height':'150px',
'min-width':'450px'
})
.editableList({
addItem: function(container, i, opt) {
var row = $('<div/>').appendTo(container);
var nameField = $('<input/>', {
class: "node-input-env-name",
type: "text",
style: "margin-length: 5px; width: 32%;",
style: "margin-left: 5px; width: calc(40% - 5px)",
placeholder: RED._("editor-tab.name")
}).appendTo(row);
var valueField = $('<input/>',{
class: "node-input-env-value",
type: "text",
style: "margin-left: 5px; width: 65%;"
style: "margin-left: 5px; width: calc(60% - 5px)"
}).appendTo(row)
valueField.typedInput({default:'str',
types:['str','num','bool','json','bin','re','date']
@ -2112,9 +2115,17 @@ RED.editor = (function() {
}
}
],
resize: function(dimensions) {
$(".editor-tray-content").height(dimensions.height - 50);
var form = $(".editor-tray-content form").height(dimensions.height - 50 - 40);
resize: function(size) {
// $(".editor-tray-content").height(size.height - 50);
// var form = $(".editor-tray-content form").height(size.height - 50 - 40);
var rows = $("#dialog-form>div:not(.node-input-env-container-row)");
var height = size.height;
for (var i=0; i<rows.size(); i++) {
height -= $(rows[i]).outerHeight(true);
}
var editorRow = $("#dialog-form>div.node-input-env-container-row");
height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
$("#node-input-env-container").editableList('height',height-80);
},
open: function(tray) {
var trayFooter = tray.find(".editor-tray-footer");