getSelectionToolboxCommands
method to specify which commands appear in the toolboxgetSelectionToolboxCommands
method is called for each item in the selection set whenever a new selection is made.
function
receives the selected item(s) as a parameter, allowing you to perform actions on the current selection.
pi pi-[icon-name]
(e.g., pi pi-star
)mdi mdi-[icon-name]
(e.g., mdi mdi-content-copy
)getSelectionToolboxCommands
method is called each time the selection changes, allowing you to show different commands based on what’s selected:
selectedItems
property is a Set that includes nodes, groups, and other canvas elements:
Comfy.Canvas.SelectionToolbox
commands
array before being referenced in getSelectionToolboxCommands
getSelectionToolboxCommands
method is called for each item in the selection set whenever a new selection is madeapp.canvas.selectedItems
(a Set) to access all selected items including nodes, groups, and other canvas elementsapp.canvas.selected_nodes
still exists but only contains nodes