merge upstream changes

This commit is contained in:
Kunihiko Toumura
2019-08-02 15:15:30 +09:00
7 changed files with 62 additions and 6 deletions

View File

@@ -368,13 +368,21 @@ RED.history = (function() {
dirty: RED.nodes.dirty()
};
if (ev.nodes) {
<<<<<<< HEAD
inv_ev.movedNodes = [];
=======
var z = ev.activeWorkspace;
>>>>>>> upstream/dev
RED.nodes.filterNodes({z:ev.subflow.subflow.id}).forEach(function(n) {
n.x += ev.subflow.offsetX;
n.y += ev.subflow.offsetY;
n.z = ev.activeWorkspace;
n.dirty = true;
<<<<<<< HEAD
inv_ev.movedNodes.push(n.id);
=======
RED.nodes.moveNodeToTab(n, z);
>>>>>>> upstream/dev
});
inv_ev.subflows = [];
for (i=0;i<ev.nodes.length;i++) {

View File

@@ -301,6 +301,17 @@ RED.nodes = (function() {
return {links:removedLinks,nodes:removedNodes};
}
function moveNodeToTab(node, z) {
if (nodeTabMap[node.z]) {
delete nodeTabMap[node.z][node.id];
}
if (!nodeTabMap[z]) {
nodeTabMap[z] = {};
}
nodeTabMap[z][node.id] = node;
node.z = z;
}
function removeLink(l) {
var index = links.indexOf(l);
if (index != -1) {
@@ -324,7 +335,7 @@ RED.nodes = (function() {
}
function removeWorkspace(id) {
delete workspaces[id];
delete nodeTabMap[ws.id];
delete nodeTabMap[id];
workspacesOrder.splice(workspacesOrder.indexOf(id),1);
var removedNodes = [];
@@ -1466,6 +1477,8 @@ RED.nodes = (function() {
remove: removeNode,
clear: clear,
moveNodeToTab: moveNodeToTab,
addLink: addLink,
removeLink: removeLink,

View File

@@ -723,7 +723,7 @@ RED.subflow = (function() {
}
n.x -= offsetX;
n.y -= offsetY;
n.z = subflow.id;
RED.nodes.moveNodeToTab(n, subflow.id);
}
RED.history.push({