diff --git a/editor/js/nodes.js b/editor/js/nodes.js index 108922c70..aa4d3bc4e 100644 --- a/editor/js/nodes.js +++ b/editor/js/nodes.js @@ -904,8 +904,14 @@ RED.nodes = (function() { } } } - - + // If importing into a subflow, ensure an outbound-link doesn't + // get added + if (activeSubflow && /^link /.test(n.type) && n.links) { + n.links = n.links.filter(function(id) { + var otherNode = RED.nodes.node(id); + return (otherNode && otherNode.z === activeWorkspace) + }); + } } for (i=0;i -1) { + otherNode.links.splice(i,1); + } + } + } + return isLocalLink; + }); + } + n.z = subflow.id; } RED.history.push({ @@ -589,7 +605,7 @@ RED.subflow = (function() { dirty:RED.nodes.dirty() }); - + RED.view.select(null); RED.editor.validateNode(subflow); RED.nodes.dirty(true); RED.view.redraw(true);