From e1a24875f0a28ce1ac8dc3ceece35db7a0fde5b5 Mon Sep 17 00:00:00 2001 From: GogoVega <92022724+GogoVega@users.noreply.github.com> Date: Tue, 28 Oct 2025 15:22:10 +0100 Subject: [PATCH] Improve with the node as context --- .../@node-red/nodes/core/common/60-link.html | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/packages/node_modules/@node-red/nodes/core/common/60-link.html b/packages/node_modules/@node-red/nodes/core/common/60-link.html index 2947b9008..9dd0ae057 100644 --- a/packages/node_modules/@node-red/nodes/core/common/60-link.html +++ b/packages/node_modules/@node-red/nodes/core/common/60-link.html @@ -312,21 +312,18 @@ inputs: 1, outputs: 1, icon: "link-call.svg", - contextMenu: [ - { - label: RED._("node-red:link.actions.jumpToTarget"), + contextMenu: function () { + const node = this; + return [{ + label: node._("link.actions.jumpToTarget"), onselect: function () { - const selection = RED.view.selection(); - const node = selection.nodes[0]; - if (node) { - const target = RED.nodes.node(node.links[0]); - if (target) { - RED.view.reveal(target.id); - } + const target = RED.nodes.node(node.links[0]); + if (target) { + RED.view.reveal(target.id); } } - } - ], + }]; + }, inputLabels: function(i) { return this.name||this._("link.linkCall"); },