mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	[groups] Lasso should select top-most group of selection
This commit is contained in:
		@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user