mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #3312 from node-red/hide-tabs-fix
Fix storing hidden tab state when not hidden via action
This commit is contained in:
commit
699063cbb0
@ -208,10 +208,20 @@ RED.workspaces = (function() {
|
|||||||
},
|
},
|
||||||
onhide: function(tab) {
|
onhide: function(tab) {
|
||||||
hideStack.push(tab.id);
|
hideStack.push(tab.id);
|
||||||
|
|
||||||
|
var hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}");
|
||||||
|
hiddenTabs[tab.id] = true;
|
||||||
|
RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs));
|
||||||
|
|
||||||
RED.events.emit("workspace:hide",{workspace: tab.id})
|
RED.events.emit("workspace:hide",{workspace: tab.id})
|
||||||
},
|
},
|
||||||
onshow: function(tab) {
|
onshow: function(tab) {
|
||||||
removeFromHideStack(tab.id);
|
removeFromHideStack(tab.id);
|
||||||
|
|
||||||
|
var hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}");
|
||||||
|
delete hiddenTabs[tab.id];
|
||||||
|
RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs));
|
||||||
|
|
||||||
RED.events.emit("workspace:show",{workspace: tab.id})
|
RED.events.emit("workspace:show",{workspace: tab.id})
|
||||||
},
|
},
|
||||||
minimumActiveTabWidth: 150,
|
minimumActiveTabWidth: 150,
|
||||||
@ -542,9 +552,6 @@ RED.workspaces = (function() {
|
|||||||
}
|
}
|
||||||
if (workspace_tabs.contains(id)) {
|
if (workspace_tabs.contains(id)) {
|
||||||
workspace_tabs.hideTab(id);
|
workspace_tabs.hideTab(id);
|
||||||
var hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}");
|
|
||||||
hiddenTabs[id] = true;
|
|
||||||
RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs));
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isHidden: function(id) {
|
isHidden: function(id) {
|
||||||
@ -572,9 +579,6 @@ RED.workspaces = (function() {
|
|||||||
}
|
}
|
||||||
workspace_tabs.activateTab(id);
|
workspace_tabs.activateTab(id);
|
||||||
}
|
}
|
||||||
var hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}");
|
|
||||||
delete hiddenTabs[id];
|
|
||||||
RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs));
|
|
||||||
},
|
},
|
||||||
refresh: function() {
|
refresh: function() {
|
||||||
RED.nodes.eachWorkspace(function(ws) {
|
RED.nodes.eachWorkspace(function(ws) {
|
||||||
|
Loading…
Reference in New Issue
Block a user