From edb8a120bde98de23b080c6fc974ee2494c53844 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 8 Oct 2021 15:09:51 +0100 Subject: [PATCH] Ensure tab state updates properly when toggling enable state --- .../@node-red/editor-client/src/js/ui/editor.js | 6 +++++- .../@node-red/editor-client/src/js/ui/workspaces.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js index 5561541fc..643110d10 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js @@ -1755,8 +1755,12 @@ RED.editor = (function() { editState.changes.disabled = workspace.disabled; editState.changed = true; workspace.disabled = disabled; - } + $("#red-ui-tab-"+(workspace.id.replace(".","-"))).toggleClass('red-ui-workspace-disabled',!!workspace.disabled); + if (workspace.id === RED.workspaces.active()) { + $("#red-ui-workspace").toggleClass("red-ui-workspace-disabled",!!workspace.disabled); + } + } if (editState.changed) { var historyEvent = { diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js b/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js index a6288a7f3..e73544f06 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js @@ -450,7 +450,7 @@ RED.workspaces = (function() { var changes = { disabled: workspace.disabled }; workspace.disabled = disabled; $("#red-ui-tab-"+(workspace.id.replace(".","-"))).toggleClass('red-ui-workspace-disabled',!!workspace.disabled); - if (id === activeWorkspace) { + if (id || activeWorkspace) { $("#red-ui-workspace").toggleClass("red-ui-workspace-disabled",!!workspace.disabled); } var historyEvent = {