Skip to content

Commit

Permalink
Merge pull request node-red#4828 from GogoVega/fix-menu-selection
Browse files Browse the repository at this point in the history
Fix menu to enable/disable selection when it's a group
  • Loading branch information
knolleary authored Jul 18, 2024
2 parents 998219a + 14ac309 commit b5fb15c
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,28 @@ RED.contextMenu = (function () {
const canRemoveFromGroup = hasSelection && !!selection.nodes[0].g
let hasGroup, isAllGroups = true, hasDisabledNode, hasEnabledNode, hasLabeledNode, hasUnlabeledNode;
if (hasSelection) {
selection.nodes.forEach(n => {
const nodes = selection.nodes.slice();
while (nodes.length) {
const n = nodes.shift();
if (n.type === 'group') {
hasGroup = true;
nodes.push(...n.nodes);
} else {
isAllGroups = false;
}
if (n.d) {
hasDisabledNode = true;
} else {
hasEnabledNode = true;
if (n.d) {
hasDisabledNode = true;
} else {
hasEnabledNode = true;
}
}
if (n.l === undefined || n.l) {
hasLabeledNode = true;
} else {
hasUnlabeledNode = true;
}
});
}
}

const offset = $("#red-ui-workspace-chart").offset()

let addX = options.x - offset.left + $("#red-ui-workspace-chart").scrollLeft()
Expand Down

0 comments on commit b5fb15c

Please sign in to comment.