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

Add core:go-to-selected-subflow action

This commit is contained in:
Nick O'Leary 2021-03-06 23:28:20 +00:00
parent 2d4f5b8603
commit 9c7db1381c
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 11 additions and 0 deletions

View File

@ -38,6 +38,7 @@
"backspace": "core:delete-selection",
"delete": "core:delete-selection",
"enter": "core:edit-selected-node",
"ctrl-enter": "core:go-to-selected-subflow",
"ctrl-c": "core:copy-selection-to-internal-clipboard",
"ctrl-x": "core:cut-selection-to-internal-clipboard",
"ctrl-v": "core:paste-from-internal-clipboard",

View File

@ -503,6 +503,7 @@ RED.view = (function() {
RED.actions.add("core:paste-from-internal-clipboard",function(){importNodes(clipboard,{generateIds: true});});
RED.actions.add("core:delete-selection",deleteSelection);
RED.actions.add("core:edit-selected-node",editSelection);
RED.actions.add("core:go-to-selected-subflow",editSelectedSubflow);
RED.actions.add("core:undo",RED.history.pop);
RED.actions.add("core:redo",RED.history.redo);
RED.actions.add("core:select-all-nodes",selectAll);
@ -2206,6 +2207,15 @@ RED.view = (function() {
}
}
function editSelectedSubflow() {
if (movingSet.length() > 0) {
var node = movingSet.get(0).n;
if (/^subflow:/.test(node.type)) {
RED.workspaces.show(node.type.substring(8))
}
}
}
function copySelection() {
if (mouse_mode === RED.state.SELECTING_NODE) {
return;