MCPcopy Create free account
hub / github.com/Comfy-Org/litegraph.js / onMenuToggleAdvanced

Method onMenuToggleAdvanced

src/LGraphCanvas.ts:1373–1396  ·  view source on GitHub ↗
(
    value: IContextMenuValue,
    options: IContextMenuOptions,
    e: MouseEvent,
    menu: ContextMenu,
    node: LGraphNode,
  )

Source from the content-addressed store, hash-verified

1371 }
1372
1373 static onMenuToggleAdvanced(
1374 value: IContextMenuValue,
1375 options: IContextMenuOptions,
1376 e: MouseEvent,
1377 menu: ContextMenu,
1378 node: LGraphNode,
1379 ): void {
1380 if (!node.graph) throw new NullGraphError()
1381
1382 node.graph.beforeChange()
1383 const fApplyMultiNode = function (node: LGraphNode) {
1384 node.toggleAdvanced()
1385 }
1386
1387 const graphcanvas = LGraphCanvas.active_canvas
1388 if (!graphcanvas.selected_nodes || Object.keys(graphcanvas.selected_nodes).length <= 1) {
1389 fApplyMultiNode(node)
1390 } else {
1391 for (const i in graphcanvas.selected_nodes) {
1392 fApplyMultiNode(graphcanvas.selected_nodes[i])
1393 }
1394 }
1395 node.graph.afterChange()
1396 }
1397
1398 static onMenuNodeMode(
1399 value: IContextMenuValue,

Callers

nothing calls this directly

Calls 2

beforeChangeMethod · 0.80
afterChangeMethod · 0.80

Tested by

no test coverage detected