1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add core:toggle-tabs action

This commit is contained in:
Nick O'Leary 2021-08-24 17:52:00 +01:00
parent 9dbe531bf7
commit 8108b93c5f
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 15 additions and 1 deletions

View File

@ -25,7 +25,9 @@
"ctrl-alt-o": "core:open-project",
"ctrl-g v": "core:show-version-control-tab",
"ctrl-shift-l": "core:show-event-log",
"ctrl-shift-p":"core:show-action-list"
"ctrl-shift-p":"core:show-action-list",
"ctrl-h": "core:hide-tab",
"ctrl-shift-h": "core:toggle-tabs"
},
"red-ui-sidebar-node-config": {
"backspace": "core:delete-config-selection",

View File

@ -396,6 +396,18 @@ RED.workspaces = (function() {
RED.workspaces.show(id, null, true)
})
})
RED.actions.add("core:toggle-tabs", function() {
var currentTabs = workspace_tabs.listTabs();
var visibleCount = workspace_tabs.count();
currentTabs.forEach(function(id) {
if (visibleCount === 0) {
RED.workspaces.show(id)
} else {
RED.workspaces.hide(id)
}
})
})
RED.actions.add("core:list-flows",function() {
RED.actions.invoke("core:search","type:tab ");