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

Do not assume subflows exist when deleting nodes

This commit is contained in:
Nick O'Leary 2014-11-13 16:00:46 +00:00
parent b4c92b457a
commit 9c8d9550a7

View File

@ -835,6 +835,7 @@ RED.view = (function() {
node.dirty = true; node.dirty = true;
} }
} }
if (removedSubflowOutputs.length > 0) {
removedSubflowOutputs.sort(function(a,b) { return b.i-a.i}); removedSubflowOutputs.sort(function(a,b) { return b.i-a.i});
for (i=0;i<removedSubflowOutputs.length;i++) { for (i=0;i<removedSubflowOutputs.length;i++) {
var output = removedSubflowOutputs[i]; var output = removedSubflowOutputs[i];
@ -862,8 +863,8 @@ RED.view = (function() {
activeSubflow.out[j].dirty = true; activeSubflow.out[j].dirty = true;
} }
} }
}
// Assume 0/1 inputs // Assume 0/1 inputs
if (removedSubflowInputs.length == 1) { if (removedSubflowInputs.length == 1) {
var input = removedSubflowInputs[0]; var input = removedSubflowInputs[0];
var subflowRemovedInputLinks = []; var subflowRemovedInputLinks = [];
@ -880,6 +881,7 @@ RED.view = (function() {
$("#workspace-subflow-add-input").toggleClass("disabled",false); $("#workspace-subflow-add-input").toggleClass("disabled",false);
} }
if (activeSubflow) {
RED.nodes.eachNode(function(n) { RED.nodes.eachNode(function(n) {
if (n.type == "subflow:"+activeSubflow.id) { if (n.type == "subflow:"+activeSubflow.id) {
n.changed = true; n.changed = true;
@ -892,6 +894,7 @@ RED.view = (function() {
n.dirty = true; n.dirty = true;
} }
}); });
}
moving_set = []; moving_set = [];
if (removedNodes.length > 0) { if (removedNodes.length > 0) {