Fix add selected nodes to empty group

This commit is contained in:
Jairo Correa 2023-10-16 15:26:36 -03:00
parent 7d5d0fd577
commit e8c02219ee
1 changed files with 9 additions and 9 deletions

View File

@ -75,6 +75,15 @@ app.registerExtension({
group.recomputeInsideNodes();
const nodesInGroup = group._nodes;
options.push({
content: "Add Selected Nodes To Group",
disabled: !Object.keys(app.canvas.selected_nodes || {}).length,
callback: () => {
addNodesToGroup(group, this.selected_nodes)
this.graph.change();
}
});
// No nodes in group, return default options
if (nodesInGroup.length === 0) {
return options;
@ -92,15 +101,6 @@ app.registerExtension({
}
}
options.push({
content: "Add Selected Nodes To Group",
disabled: !Object.keys(app.canvas.selected_nodes || {}).length,
callback: () => {
addNodesToGroup(group, this.selected_nodes)
this.graph.change();
}
});
options.push({
content: "Fit Group To Nodes",
callback: () => {