diff --git a/packages/node_modules/@node-red/editor-client/src/js/nodes.js b/packages/node_modules/@node-red/editor-client/src/js/nodes.js index f4378850f..fae5a2f97 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/nodes.js +++ b/packages/node_modules/@node-red/editor-client/src/js/nodes.js @@ -266,8 +266,8 @@ RED.nodes = (function() { }, moveNode: function(n, newZ) { api.removeNode(n); - tabMap[newZ] = tabMap[newZ] || []; - tabMap[newZ].push(n); + n.z = newZ; + api.addNode(n) }, moveNodesForwards: function(nodes) { var result = []; @@ -719,29 +719,29 @@ RED.nodes = (function() { moveGroupToTab(node,z); return; } + var oldZ = node.z; allNodes.moveNode(node,z); var nl = nodeLinks[node.id]; if (nl) { nl.in.forEach(function(l) { - var idx = linkTabMap[node.z].indexOf(l); + var idx = linkTabMap[oldZ].indexOf(l); if (idx != -1) { - linkTabMap[node.z].splice(idx, 1); + linkTabMap[oldZ].splice(idx, 1); } if ((l.source.z === z) && linkTabMap[z]) { linkTabMap[z].push(l); } }); nl.out.forEach(function(l) { - var idx = linkTabMap[node.z].indexOf(l); + var idx = linkTabMap[oldZ].indexOf(l); if (idx != -1) { - linkTabMap[node.z].splice(idx, 1); + linkTabMap[oldZ].splice(idx, 1); } if ((l.target.z === z) && linkTabMap[z]) { linkTabMap[z].push(l); } }); } - node.z = z; RED.events.emit("nodes:change",node); } function moveGroupToTab(group, z) {