mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Restore drag-to-detach action
This commit is contained in:
		@@ -1798,15 +1798,32 @@ RED.view = (function() {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        if (mousedown_node && mouse_mode == RED.state.JOINING) {
 | 
			
		||||
            // Trigger quick add dialog
 | 
			
		||||
            d3.event.stopPropagation();
 | 
			
		||||
            clearSelection();
 | 
			
		||||
            const point = d3.mouse(this);
 | 
			
		||||
            var clickedGroup = getGroupAt(point[0], point[1]);
 | 
			
		||||
            if (drag_lines.length > 0) {
 | 
			
		||||
                clickedGroup = clickedGroup || RED.nodes.group(drag_lines[0].node.g)
 | 
			
		||||
            var removedLinks = [];
 | 
			
		||||
            for (i=0;i<drag_lines.length;i++) {
 | 
			
		||||
                if (drag_lines[i].link) {
 | 
			
		||||
                    removedLinks.push(drag_lines[i].link)
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            showQuickAddDialog({ position: point, group: clickedGroup });
 | 
			
		||||
            if (removedLinks.length > 0) {
 | 
			
		||||
                historyEvent = {
 | 
			
		||||
                    t:"delete",
 | 
			
		||||
                    links: removedLinks,
 | 
			
		||||
                    dirty:RED.nodes.dirty()
 | 
			
		||||
                };
 | 
			
		||||
                RED.history.push(historyEvent);
 | 
			
		||||
                RED.nodes.dirty(true);
 | 
			
		||||
            } else {
 | 
			
		||||
                // Trigger quick add dialog
 | 
			
		||||
                d3.event.stopPropagation();
 | 
			
		||||
                clearSelection();
 | 
			
		||||
                const point = d3.mouse(this);
 | 
			
		||||
                var clickedGroup = getGroupAt(point[0], point[1]);
 | 
			
		||||
                if (drag_lines.length > 0) {
 | 
			
		||||
                    clickedGroup = clickedGroup || RED.nodes.group(drag_lines[0].node.g)
 | 
			
		||||
                }
 | 
			
		||||
                showQuickAddDialog({ position: point, group: clickedGroup });
 | 
			
		||||
            }
 | 
			
		||||
            hideDragLines();
 | 
			
		||||
        }
 | 
			
		||||
        if (lasso) {
 | 
			
		||||
            var x = parseInt(lasso.attr("x"));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user