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

Ensure a second paste of cut nodes is treated as a copy-paste

This commit is contained in:
Nick O'Leary 2022-07-04 20:46:21 +01:00
parent 829ccc3466
commit 78ed53f4fb
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -630,7 +630,9 @@ RED.view = (function() {
RED.actions.add("core:copy-selection-to-internal-clipboard",copySelection); RED.actions.add("core:copy-selection-to-internal-clipboard",copySelection);
RED.actions.add("core:cut-selection-to-internal-clipboard",function(){copySelection(true);deleteSelection();}); RED.actions.add("core:cut-selection-to-internal-clipboard",function(){copySelection(true);deleteSelection();});
RED.actions.add("core:paste-from-internal-clipboard",function(){importNodes(clipboard,{generateIds: clipboardSource === 'copy', generateDefaultNames: clipboardSource === 'copy'});}); RED.actions.add("core:paste-from-internal-clipboard",function(){
importNodes(clipboard,{generateIds: clipboardSource === 'copy', generateDefaultNames: clipboardSource === 'copy'});
});
RED.actions.add("core:detach-selected-nodes", function() { detachSelectedNodes() }) RED.actions.add("core:detach-selected-nodes", function() { detachSelectedNodes() })
@ -2150,6 +2152,9 @@ RED.view = (function() {
} }
} }
if (mouse_mode == RED.state.IMPORT_DRAGGING) { if (mouse_mode == RED.state.IMPORT_DRAGGING) {
if (clipboardSource === 'cut') {
clipboardSource = 'copy'
}
updateActiveNodes(); updateActiveNodes();
RED.nodes.dirty(true); RED.nodes.dirty(true);
} }
@ -3479,6 +3484,9 @@ RED.view = (function() {
updateSelection(); updateSelection();
RED.nodes.dirty(true); RED.nodes.dirty(true);
redraw(); redraw();
if (clipboardSource === 'cut') {
clipboardSource = 'copy'
}
resetMouseVars(); resetMouseVars();
d3.event.stopPropagation(); d3.event.stopPropagation();
return; return;