Skip to content

Commit 9f3245d

Browse files
committed
refactor: Only show Align options if more than one node is selected
1 parent badf134 commit 9f3245d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/litegraph.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12977,14 +12977,21 @@ LGraphNode.prototype.executeAction = function(action)
1297712977
callback: LGraphCanvas.onMenuAdd
1297812978
},
1297912979
{ content: "Add Group", callback: LGraphCanvas.onGroupAdd },
12980-
{ content: "Align", has_submenu: true, callback: LGraphCanvas.onGroupAlign },
1298112980
//{ content: "Arrange", callback: that.graph.arrange },
1298212981
//{content:"Collapse All", callback: LGraphCanvas.onMenuCollapseAll }
1298312982
];
1298412983
/*if (LiteGraph.showCanvasOptions){
1298512984
options.push({ content: "Options", callback: that.showShowGraphOptionsPanel });
1298612985
}*/
1298712986

12987+
if (Object.keys(this.selected_nodes).length > 1) {
12988+
options.push({
12989+
content: "Align",
12990+
has_submenu: true,
12991+
callback: LGraphCanvas.onGroupAlign,
12992+
})
12993+
}
12994+
1298812995
if (this._graph_stack && this._graph_stack.length > 0) {
1298912996
options.push(null, {
1299012997
content: "Close subgraph",

0 commit comments

Comments
 (0)