mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
parent
f030694ef4
commit
eebb64901c
@ -266,8 +266,8 @@ RED.nodes = (function() {
|
|||||||
},
|
},
|
||||||
moveNode: function(n, newZ) {
|
moveNode: function(n, newZ) {
|
||||||
api.removeNode(n);
|
api.removeNode(n);
|
||||||
tabMap[newZ] = tabMap[newZ] || [];
|
n.z = newZ;
|
||||||
tabMap[newZ].push(n);
|
api.addNode(n)
|
||||||
},
|
},
|
||||||
moveNodesForwards: function(nodes) {
|
moveNodesForwards: function(nodes) {
|
||||||
var result = [];
|
var result = [];
|
||||||
@ -719,29 +719,29 @@ RED.nodes = (function() {
|
|||||||
moveGroupToTab(node,z);
|
moveGroupToTab(node,z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
var oldZ = node.z;
|
||||||
allNodes.moveNode(node,z);
|
allNodes.moveNode(node,z);
|
||||||
var nl = nodeLinks[node.id];
|
var nl = nodeLinks[node.id];
|
||||||
if (nl) {
|
if (nl) {
|
||||||
nl.in.forEach(function(l) {
|
nl.in.forEach(function(l) {
|
||||||
var idx = linkTabMap[node.z].indexOf(l);
|
var idx = linkTabMap[oldZ].indexOf(l);
|
||||||
if (idx != -1) {
|
if (idx != -1) {
|
||||||
linkTabMap[node.z].splice(idx, 1);
|
linkTabMap[oldZ].splice(idx, 1);
|
||||||
}
|
}
|
||||||
if ((l.source.z === z) && linkTabMap[z]) {
|
if ((l.source.z === z) && linkTabMap[z]) {
|
||||||
linkTabMap[z].push(l);
|
linkTabMap[z].push(l);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
nl.out.forEach(function(l) {
|
nl.out.forEach(function(l) {
|
||||||
var idx = linkTabMap[node.z].indexOf(l);
|
var idx = linkTabMap[oldZ].indexOf(l);
|
||||||
if (idx != -1) {
|
if (idx != -1) {
|
||||||
linkTabMap[node.z].splice(idx, 1);
|
linkTabMap[oldZ].splice(idx, 1);
|
||||||
}
|
}
|
||||||
if ((l.target.z === z) && linkTabMap[z]) {
|
if ((l.target.z === z) && linkTabMap[z]) {
|
||||||
linkTabMap[z].push(l);
|
linkTabMap[z].push(l);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
node.z = z;
|
|
||||||
RED.events.emit("nodes:change",node);
|
RED.events.emit("nodes:change",node);
|
||||||
}
|
}
|
||||||
function moveGroupToTab(group, z) {
|
function moveGroupToTab(group, z) {
|
||||||
|
Loading…
Reference in New Issue
Block a user