disable hide all menu if all tabs hidden

This commit is contained in:
Hiroyasu Nishiyama 2023-01-30 11:42:53 +09:00
parent a607ee90e0
commit 66f9686e48
1 changed files with 11 additions and 2 deletions

View File

@ -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",