From 56d3e084afecd988c0f6b8a71fc6224a7ad33107 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Thu, 12 Sep 2024 14:09:24 +0900 Subject: [PATCH] Pin/Unpin all selected nodes on context menu (#136) --- src/litegraph.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/litegraph.js b/src/litegraph.js index 44c504b53..ef223a44c 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -6164,7 +6164,6 @@ const globalExport = {}; node.graph.afterChange( /*?*/); } static onMenuNodePin(value, options, e, menu, node) { - node.pin(); } static onMenuNodeMode(value, options, e, menu, node) { new LiteGraph.ContextMenu( @@ -13173,7 +13172,13 @@ const globalExport = {}; options.push( { content: node.pinned ? "Unpin" : "Pin", - callback: LGraphCanvas.onMenuNodePin + callback: (...args) => { + LGraphCanvas.onMenuNodePin(...args); + for (const i in this.selected_nodes) { + const node = this.selected_nodes[i] + node.pin() + } + } }, { content: "Colors",