mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 19:21:54 +00:00
refactor: Only show Align options if more than one node is selected
This commit is contained in:
@@ -12977,7 +12977,6 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
callback: LGraphCanvas.onMenuAdd
|
callback: LGraphCanvas.onMenuAdd
|
||||||
},
|
},
|
||||||
{ content: "Add Group", callback: LGraphCanvas.onGroupAdd },
|
{ content: "Add Group", callback: LGraphCanvas.onGroupAdd },
|
||||||
{ content: "Align", has_submenu: true, callback: LGraphCanvas.onGroupAlign },
|
|
||||||
//{ content: "Arrange", callback: that.graph.arrange },
|
//{ content: "Arrange", callback: that.graph.arrange },
|
||||||
//{content:"Collapse All", callback: LGraphCanvas.onMenuCollapseAll }
|
//{content:"Collapse All", callback: LGraphCanvas.onMenuCollapseAll }
|
||||||
];
|
];
|
||||||
@@ -12985,6 +12984,14 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
options.push({ content: "Options", callback: that.showShowGraphOptionsPanel });
|
options.push({ content: "Options", callback: that.showShowGraphOptionsPanel });
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
if (Object.keys(this.selected_nodes).length > 1) {
|
||||||
|
options.push({
|
||||||
|
content: "Align",
|
||||||
|
has_submenu: true,
|
||||||
|
callback: LGraphCanvas.onGroupAlign,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if (this._graph_stack && this._graph_stack.length > 0) {
|
if (this._graph_stack && this._graph_stack.length > 0) {
|
||||||
options.push(null, {
|
options.push(null, {
|
||||||
content: "Close subgraph",
|
content: "Close subgraph",
|
||||||
|
|||||||
Reference in New Issue
Block a user