1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

not emit change event on group delete

This commit is contained in:
Hiroyasu Nishiyama 2020-05-25 08:46:35 +09:00
parent c5ca9fafee
commit 05f816fc5d
2 changed files with 14 additions and 10 deletions

View File

@ -362,9 +362,6 @@ RED.sidebar.info.outliner = (function() {
var existingObject = objects[n.id]; var existingObject = objects[n.id];
var parent = n.g||n.z; var parent = n.g||n.z;
if (!existingObject) {
return;
}
var nodeLabelText = getNodeLabelText(n); var nodeLabelText = getNodeLabelText(n);
if (nodeLabelText) { if (nodeLabelText) {
existingObject.element.find(".red-ui-info-outline-item-label").text(nodeLabelText); existingObject.element.find(".red-ui-info-outline-item-label").text(nodeLabelText);
@ -373,9 +370,7 @@ RED.sidebar.info.outliner = (function() {
} }
if (parent !== existingObject.parent.id) { if (parent !== existingObject.parent.id) {
if (existingObject.treeList) { existingObject.treeList.remove();
existingObject.treeList.remove();
}
if (!parent) { if (!parent) {
globalConfigNodes.treeList.addChild(existingObject); globalConfigNodes.treeList.addChild(existingObject);
} else { } else {

View File

@ -1943,10 +1943,14 @@ if (DEBUG_EVENTS) { console.warn("clearSelection", mouse_mode); }
if (moving_set.length > 0) { if (moving_set.length > 0) {
for (var i=0;i<moving_set.length;i++) { for (var i=0;i<moving_set.length;i++) {
var node = moving_set[i].n; var node = moving_set[i].n;
node.selected = false;
if (node.type === "group") { if (node.type === "group") {
selectedGroups.push(node); selectedGroups.push(node);
} else if (node.type != "subflow") { }
}
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")) {
if (node.x < 0) { if (node.x < 0) {
node.x = 25 node.x = 25
} }
@ -1957,8 +1961,13 @@ if (DEBUG_EVENTS) { console.warn("clearSelection", mouse_mode); }
if (node.g) { if (node.g) {
var group = RED.nodes.group(node.g); var group = RED.nodes.group(node.g);
if (!group.selected || group.active) { if (!group.selected || group.active) {
RED.group.removeFromGroup(group,node); var isSelectedGroup = selectedGroups.find(function (ng) {
node.g = group.id; return (ng.id === node.g);
});
if (!isSelectedGroup) {
RED.group.removeFromGroup(group,node);
node.g = group.id;
}
} }
} }
} else { } else {