mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add core:show-last-hidden-tab and update keymap
This commit is contained in:
parent
7962278475
commit
0874ba7a03
@ -26,8 +26,8 @@
|
||||
"ctrl-g v": "core:show-version-control-tab",
|
||||
"ctrl-shift-l": "core:show-event-log",
|
||||
"ctrl-shift-p":"core:show-action-list",
|
||||
"ctrl-h": "core:hide-tab",
|
||||
"ctrl-shift-h": "core:toggle-tabs"
|
||||
"alt-w": "core:hide-tab",
|
||||
"alt-shift-w": "core:show-last-hidden-tab"
|
||||
},
|
||||
"red-ui-sidebar-node-config": {
|
||||
"backspace": "core:delete-config-selection",
|
||||
|
@ -21,6 +21,7 @@ RED.workspaces = (function() {
|
||||
var workspaceIndex = 0;
|
||||
|
||||
var viewStack = [];
|
||||
var hideStack = [];
|
||||
var viewStackPos = 0;
|
||||
|
||||
|
||||
@ -30,7 +31,6 @@ RED.workspaces = (function() {
|
||||
}
|
||||
viewStack.push(id);
|
||||
viewStackPos = viewStack.length;
|
||||
// console.warn("addToViewStack",id,viewStack);
|
||||
}
|
||||
|
||||
function addWorkspace(ws,skipHistoryEntry,targetIndex) {
|
||||
@ -296,6 +296,8 @@ RED.workspaces = (function() {
|
||||
onremove: function(tab) {
|
||||
if (tab.type === "tab") {
|
||||
workspaceTabCount--;
|
||||
} else {
|
||||
hideStack.push(tab.id);
|
||||
}
|
||||
RED.menu.setDisabled("menu-item-workspace-delete",activeWorkspace === 0 || workspaceTabCount <= 1);
|
||||
if (workspaceTabCount === 0) {
|
||||
@ -323,9 +325,14 @@ RED.workspaces = (function() {
|
||||
}
|
||||
},
|
||||
onhide: function(tab) {
|
||||
hideStack.push(tab.id);
|
||||
RED.events.emit("workspace:hide",{workspace: tab.id})
|
||||
},
|
||||
onshow: function(tab) {
|
||||
var i = hideStack.indexOf(tab.id);
|
||||
if (i > -1) {
|
||||
hideStack.splice(i,1);
|
||||
}
|
||||
RED.events.emit("workspace:show",{workspace: tab.id})
|
||||
},
|
||||
minimumActiveTabWidth: 150,
|
||||
@ -413,7 +420,10 @@ RED.workspaces = (function() {
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
RED.actions.add("core:show-last-hidden-tab", function() {
|
||||
var id = hideStack.pop();
|
||||
RED.workspaces.show(id);
|
||||
})
|
||||
|
||||
RED.actions.add("core:list-flows",function() {
|
||||
RED.actions.invoke("core:search","type:tab ");
|
||||
@ -545,6 +555,11 @@ RED.workspaces = (function() {
|
||||
null,
|
||||
workspace_tabs.activeIndex()+1
|
||||
);
|
||||
var i = hideStack.indexOf(id);
|
||||
if (i > -1) {
|
||||
hideStack.splice(i,1);
|
||||
}
|
||||
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user