mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
simplify code structure
This commit is contained in:
parent
05f816fc5d
commit
3345f2f3b8
@ -1943,14 +1943,10 @@ if (DEBUG_EVENTS) { console.warn("clearSelection", mouse_mode); }
|
||||
if (moving_set.length > 0) {
|
||||
for (var i=0;i<moving_set.length;i++) {
|
||||
var node = moving_set[i].n;
|
||||
node.selected = false;
|
||||
if (node.type === "group") {
|
||||
selectedGroups.push(node);
|
||||
}
|
||||
}
|
||||
for (var i=0;i<moving_set.length;i++) {
|
||||
var node = moving_set[i].n;
|
||||
node.selected = false;
|
||||
if ((node.type !== "group") && (node.type != "subflow")) {
|
||||
} else if (node.type != "subflow") {
|
||||
if (node.x < 0) {
|
||||
node.x = 25
|
||||
}
|
||||
@ -1960,14 +1956,9 @@ if (DEBUG_EVENTS) { console.warn("clearSelection", mouse_mode); }
|
||||
removedLinks = removedLinks.concat(removedEntities.links);
|
||||
if (node.g) {
|
||||
var group = RED.nodes.group(node.g);
|
||||
if (!group.selected || group.active) {
|
||||
var isSelectedGroup = selectedGroups.find(function (ng) {
|
||||
return (ng.id === node.g);
|
||||
});
|
||||
if (!isSelectedGroup) {
|
||||
RED.group.removeFromGroup(group,node);
|
||||
node.g = group.id;
|
||||
}
|
||||
if ((!group.selected || group.active) && (selectedGroups.indexOf(group) < 0)) {
|
||||
RED.group.removeFromGroup(group,node);
|
||||
node.g = group.id;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user