mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
[groups] Support deleting groups as part of selection
This commit is contained in:
parent
4d96d95370
commit
9a0c843f29
@ -1455,6 +1455,15 @@ RED.nodes = (function() {
|
|||||||
function removeGroup(group) {
|
function removeGroup(group) {
|
||||||
var i = groupsByZ[group.z].indexOf(group);
|
var i = groupsByZ[group.z].indexOf(group);
|
||||||
groupsByZ[group.z].splice(i,1);
|
groupsByZ[group.z].splice(i,1);
|
||||||
|
|
||||||
|
if (group.g) {
|
||||||
|
if (groups[group.g]) {
|
||||||
|
var index = groups[group.g].nodes.indexOf(group);
|
||||||
|
groups[group.g].nodes.splice(index,1);
|
||||||
|
groups[group.g].dirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
delete groups[group.id];
|
delete groups[group.id];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,10 +92,6 @@ RED.group = (function() {
|
|||||||
function ungroup(g) {
|
function ungroup(g) {
|
||||||
var nodes = [];
|
var nodes = [];
|
||||||
var parentGroup = RED.nodes.group(g.g);
|
var parentGroup = RED.nodes.group(g.g);
|
||||||
if (parentGroup) {
|
|
||||||
var index = parentGroup.nodes.indexOf(g);
|
|
||||||
parentGroup.nodes.splice(index,1);
|
|
||||||
}
|
|
||||||
g.nodes.forEach(function(n) {
|
g.nodes.forEach(function(n) {
|
||||||
nodes.push(n);
|
nodes.push(n);
|
||||||
if (parentGroup) {
|
if (parentGroup) {
|
||||||
|
@ -1823,6 +1823,10 @@ if (DEBUG_EVENTS) { console.warn("clearSelection", mouse_mode); }
|
|||||||
node.dirty = true;
|
node.dirty = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var selectedGroups = activeGroups.filter(function(g) { return !g.active && g.selected });
|
||||||
|
selectedGroups.forEach(function(g) {
|
||||||
|
RED.nodes.removeGroup(g);
|
||||||
|
});
|
||||||
if (removedSubflowOutputs.length > 0) {
|
if (removedSubflowOutputs.length > 0) {
|
||||||
result = RED.subflow.removeOutput(removedSubflowOutputs);
|
result = RED.subflow.removeOutput(removedSubflowOutputs);
|
||||||
if (result) {
|
if (result) {
|
||||||
|
Loading…
Reference in New Issue
Block a user