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:
parent
f0038e9796
commit
64af1f7e9b
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user