mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
disable hide all menu if all tabs hidden
This commit is contained in:
parent
a607ee90e0
commit
66f9686e48
@ -143,6 +143,14 @@ RED.workspaces = (function() {
|
||||
const hiddenflowCount = hiddenFlows.size;
|
||||
let activeWorkspace = tab || RED.nodes.workspace(RED.workspaces.active()) || RED.nodes.subflow(RED.workspaces.active())
|
||||
let isFlowDisabled = activeWorkspace ? activeWorkspace.disabled : false
|
||||
const currentTabs = workspace_tabs.listTabs();
|
||||
let flowCount = 0;
|
||||
currentTabs.forEach(tab => {
|
||||
console.log("; TAB: ", tab);
|
||||
if (RED.nodes.workspace(tab)) {
|
||||
flowCount++;
|
||||
}
|
||||
});
|
||||
|
||||
var menuItems = []
|
||||
if (isMenuButton) {
|
||||
@ -194,7 +202,6 @@ RED.workspaces = (function() {
|
||||
}
|
||||
)
|
||||
}
|
||||
const currentTabs = workspace_tabs.listTabs()
|
||||
const activeIndex = currentTabs.findIndex(id => id === activeWorkspace.id)
|
||||
menuItems.push(
|
||||
{
|
||||
@ -236,11 +243,13 @@ RED.workspaces = (function() {
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
menuItems.push(
|
||||
{
|
||||
id:"red-ui-tabs-menu-option-add-hide-all-flows",
|
||||
label: RED._("workspace.hideAllFlows"),
|
||||
onselect: "core:hide-all-flows"
|
||||
onselect: "core:hide-all-flows",
|
||||
disabled: (hiddenflowCount === flowCount)
|
||||
},
|
||||
{
|
||||
id:"red-ui-tabs-menu-option-add-show-all-flows",
|
||||
|
Loading…
Reference in New Issue
Block a user