From 94bc887369d5ba3a4e4fb9b9ec195cdc5609b23e Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 3 Mar 2023 16:09:04 +0000 Subject: [PATCH] Restore drag-to-detach action --- .../@node-red/editor-client/src/js/ui/view.js | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index aeaf4a1a9..3ffb6d62d 100755 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -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 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"));