From 90e32f52c9535e340c67279aeac1f04d97535797 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 22 May 2023 16:51:17 +0100 Subject: [PATCH] Enable RED.view.select to select group by id --- .../node_modules/@node-red/editor-client/src/js/red.js | 2 +- .../node_modules/@node-red/editor-client/src/js/ui/view.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/red.js b/packages/node_modules/@node-red/editor-client/src/js/red.js index b45f0378a..89464bd6c 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/red.js +++ b/packages/node_modules/@node-red/editor-client/src/js/red.js @@ -274,7 +274,7 @@ var RED = (function() { if (nodeToShow) { RED.view.reveal(nodeToShow.id) window.location.hash = currentHash - RED.view.select({ nodes: [nodeToShow] }) + RED.view.select(nodeToShow.id) if (showEditDialog) { RED.editor.editGroup(nodeToShow) } 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 04fcf1335..9fdbc3dde 100644 --- 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 @@ -6114,6 +6114,13 @@ RED.view = (function() { selectedNode.dirty = true; movingSet.clear(); movingSet.add(selectedNode); + } else { + selectedNode = RED.nodes.group(selection); + if (selectedNode) { + movingSet.clear(); + selectedGroups.clear() + selectedGroups.add(selectedNode) + } } } else if (selection) { if (selection.nodes) {