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

Handle missing tab.disabled property

This commit is contained in:
Nick O'Leary 2018-11-13 13:39:06 +00:00
parent e6e7747ae1
commit 2dfb443625
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -107,8 +107,8 @@ RED.workspaces = (function() {
changed = true; changed = true;
workspace.info = info; workspace.info = info;
} }
$("#red-ui-tab-"+(workspace.id.replace(".","-"))).toggleClass('workspace-disabled',workspace.disabled); $("#red-ui-tab-"+(workspace.id.replace(".","-"))).toggleClass('workspace-disabled',!!workspace.disabled);
$("#workspace").toggleClass("workspace-disabled",workspace.disabled); $("#workspace").toggleClass("workspace-disabled",!!workspace.disabled);
if (changed) { if (changed) {
var historyEvent = { var historyEvent = {
@ -254,10 +254,9 @@ RED.workspaces = (function() {
} }
activeWorkspace = tab.id; activeWorkspace = tab.id;
event.workspace = activeWorkspace; event.workspace = activeWorkspace;
// $("#workspace").toggleClass("workspace-disabled",tab.disabled);
RED.events.emit("workspace:change",event); RED.events.emit("workspace:change",event);
window.location.hash = 'flow/'+tab.id; window.location.hash = 'flow/'+tab.id;
$("#workspace").toggleClass("workspace-disabled",tab.disabled); $("#workspace").toggleClass("workspace-disabled",!!tab.disabled);
RED.sidebar.config.refresh(); RED.sidebar.config.refresh();
RED.view.focus(); RED.view.focus();
}, },