diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js index 5ba6e5dfe..6949ad261 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js @@ -152,7 +152,7 @@ RED.sidebar.info.outliner = (function() { // evt.stopPropagation(); // RED.view.reveal(n.id); // }) - if (n.type !== 'group' && n.type !== 'subflow') { + if (n.type !== 'subflow') { var toggleButton = $('').appendTo(controls).on("click",function(evt) { evt.preventDefault(); evt.stopPropagation(); @@ -162,6 +162,45 @@ RED.sidebar.info.outliner = (function() { } else { RED.workspaces.disable(n.id) } + } else if (n.type === 'group') { + var groupNodes = RED.group.getNodes(n,true); + var groupHistoryEvent = { + t:'multi', + events:[], + dirty: RED.nodes.dirty() + } + var targetState; + groupNodes.forEach(function(n) { + if (n.type !== 'group') { + if (targetState === undefined) { + targetState = !n.d; + } + if (!!n.d !== targetState) { + var historyEvent = { + t: "edit", + node: n, + changed: n.changed, + changes: { + d: n.d + } + } + if (n.d) { + delete n.d; + } else { + n.d = true; + } + n.dirty = true; + n.changed = true; + RED.events.emit("nodes:change",n); + groupHistoryEvent.events.push(historyEvent); + } + } + if (groupHistoryEvent.events.length > 0) { + RED.history.push(groupHistoryEvent); + RED.nodes.dirty(true) + RED.view.redraw(); + } + }) } else { // TODO: this ought to be a utility function in RED.nodes var historyEvent = { @@ -181,11 +220,15 @@ RED.sidebar.info.outliner = (function() { n.dirty = true; n.changed = true; RED.events.emit("nodes:change",n); + RED.history.push(historyEvent); RED.nodes.dirty(true) RED.view.redraw(); } }); RED.popover.tooltip(toggleButton,function() { + if (n.type === "group") { + return RED._("common.label.enable")+" / "+RED._("common.label.disable") + } return RED._("common.label."+(((n.type==='tab' && n.disabled) || (n.type!=='tab' && n.d))?"enable":"disable")); }); } else {