mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Search subflows instances when looking for given node id
This commit is contained in:
parent
9c474cc089
commit
d3d9533493
@ -176,9 +176,9 @@ class Flow {
|
||||
subflowDefinition,
|
||||
node
|
||||
);
|
||||
this.subflowInstanceNodes[id] = subflow;
|
||||
subflow.start();
|
||||
this.activeNodes[id] = subflow.node;
|
||||
this.subflowInstanceNodes[id] = subflow;
|
||||
|
||||
// this.subflowInstanceNodes[id] = nodes.map(function(n) { return n.id});
|
||||
// for (var i=0;i<nodes.length;i++) {
|
||||
@ -313,6 +313,19 @@ class Flow {
|
||||
} else if (this.activeNodes[id]) {
|
||||
// TEMP: this is a subflow internal node within this flow
|
||||
return this.activeNodes[id];
|
||||
} else {
|
||||
// The node could be inside one of this flow's subflows
|
||||
var node;
|
||||
for (var sfId in this.subflowInstanceNodes) {
|
||||
if (this.subflowInstanceNodes.hasOwnProperty(sfId)) {
|
||||
node = this.subflowInstanceNodes[sfId].getNode(id,cancelBubble);
|
||||
if (node) {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (!cancelBubble) {
|
||||
return this.parent.getNode(id);
|
||||
|
Loading…
Reference in New Issue
Block a user