mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Ensure node labels are reordered properly to match outputs
This commit is contained in:
parent
483306e73c
commit
e69e5b4f50
@ -937,11 +937,20 @@ RED.editor = (function() {
|
|||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
hasNonBlankLabel = false;
|
hasNonBlankLabel = false;
|
||||||
newValue = outputLabels.map(function() {
|
newValue = new Array(editing_node.outputs);
|
||||||
|
outputLabels.each(function() {
|
||||||
|
var index = $(this).attr('id').substring(23); // node-label-form-output-<index>
|
||||||
|
if (outputMap.hasOwnProperty(index)) {
|
||||||
|
index = parseInt(outputMap[index]);
|
||||||
|
if (index === -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
var v = $(this).val();
|
var v = $(this).val();
|
||||||
hasNonBlankLabel = hasNonBlankLabel || v!== "";
|
hasNonBlankLabel = hasNonBlankLabel || v!== "";
|
||||||
return v;
|
newValue[index] = v;
|
||||||
}).toArray().slice(0,editing_node.outputs);
|
})
|
||||||
|
|
||||||
if ((editing_node.outputLabels === undefined && hasNonBlankLabel) ||
|
if ((editing_node.outputLabels === undefined && hasNonBlankLabel) ||
|
||||||
(editing_node.outputLabels !== undefined && JSON.stringify(newValue) !== JSON.stringify(editing_node.outputLabels))) {
|
(editing_node.outputLabels !== undefined && JSON.stringify(newValue) !== JSON.stringify(editing_node.outputLabels))) {
|
||||||
changes.outputLabels = editing_node.outputLabels;
|
changes.outputLabels = editing_node.outputLabels;
|
||||||
|
Loading…
Reference in New Issue
Block a user