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

Method onMenuNodeCollapse

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

Source from the content-addressed store, hash-verified

1344 }
1345
1346 static onMenuNodeCollapse(
1347 value: IContextMenuValue,
1348 options: IContextMenuOptions,
1349 e: MouseEvent,
1350 menu: ContextMenu,
1351 node: LGraphNode,
1352 ): void {
1353 if (!node.graph) throw new NullGraphError()
1354
1355 node.graph.beforeChange()
1356
1357 const fApplyMultiNode = function (node: LGraphNode) {
1358 node.collapse()
1359 }
1360
1361 const graphcanvas = LGraphCanvas.active_canvas
1362 if (!graphcanvas.selected_nodes || Object.keys(graphcanvas.selected_nodes).length <= 1) {
1363 fApplyMultiNode(node)
1364 } else {
1365 for (const i in graphcanvas.selected_nodes) {
1366 fApplyMultiNode(graphcanvas.selected_nodes[i])
1367 }
1368 }
1369
1370 node.graph.afterChange()
1371 }
1372
1373 static onMenuToggleAdvanced(
1374 value: IContextMenuValue,

Callers

nothing calls this directly

Calls 2

beforeChangeMethod · 0.80
afterChangeMethod · 0.80

Tested by

no test coverage detected