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

[groups] Lasso should select top-most group of selection

This commit is contained in:
Nick O'Leary 2020-03-23 22:04:40 +00:00
parent f0038e9796
commit 64af1f7e9b
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -1453,15 +1453,16 @@ if (DEBUG_EVENTS) { console.warn("canvasMouseUp", mouse_mode); }
if (!d3.event.shiftKey) {
clearSelection();
}
var selectedGroups = [];
activeNodes.forEach(function(n) {
if (n.z == RED.workspaces.active() && !n.selected) {
if (!n.selected) {
if (n.x > x && n.x < x2 && n.y > y && n.y < y2) {
if (n.g) {
var group = RED.nodes.group(n.g);
while (group.g) {
group = RED.nodes.group(group.g);
}
if (!group.selected) {
selectGroup(group,true);
selectedGroups.push(group)
}
} else {
n.selected = true;
@ -1471,16 +1472,16 @@ if (DEBUG_EVENTS) { console.warn("canvasMouseUp", mouse_mode); }
}
}
});
var selectionChanged = false;
do {
selectionChanged = false;
selectedGroups.forEach(function(g) {
if (g.g && g.selected && RED.nodes.group(g.g).selected) {
g.selected = false;
selectionChanged = true;
}
})
} while(selectionChanged);
// var selectionChanged = false;
// do {
// selectionChanged = false;
// selectedGroups.forEach(function(g) {
// if (g.g && g.selected && RED.nodes.group(g.g).selected) {
// g.selected = false;
// selectionChanged = true;
// }
// })
// } while(selectionChanged);
if (activeSubflow) {
activeSubflow.in.forEach(function(n) {