mirror of https://github.com/node-red/node-red.git
Fix menu to enable/disable selection when it's a group
parent
29b128e5e0
commit
14ac309b6e
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue