Improve with the node as context

pull/5333/head
GogoVega 2025-10-28 15:22:10 +01:00
parent 9e722ee9ac
commit e1a24875f0
No known key found for this signature in database
GPG Key ID: E1E048B63AC5AC2B
1 changed files with 9 additions and 12 deletions

View File

@ -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");
},