diff --git a/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json b/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json index 4fd83854b..5e928915d 100755 --- a/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json @@ -528,7 +528,8 @@ "node": "Node", "flow": "Flow", "global": "Global", - "deleteConfirm": "Are you sure you want to delete this item?" + "deleteConfirm": "Are you sure you want to delete this item?", + "autoRefresh": "Auto-refresh" }, "palette": { "name": "Palette management", diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/toggleButton.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/toggleButton.js index 8e8b13326..1a52183d3 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/toggleButton.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/toggleButton.js @@ -17,13 +17,14 @@ /** * options: - * - invertState : boolean - if "true" the button will show "enabled" when the + * - invertState : boolean - if "true" the button will show "enabled" when the * checkbox is not selected and vice versa. - * - enabledIcon : string - the icon for "enabled" state, default "fa-check-square-o" - * - enabledLabel : string - the label for "enabled" state, default "Enabled" ("editor:workspace.enabled") - * - disabledIcon : string - the icon for "disabled" state, default "fa-square-o" + * - enabledIcon : string - the icon for "enabled" state, default "fa-check-square-o" + * - enabledLabel : string - the label for "enabled" state, default "Enabled" ("editor:workspace.enabled") + * - disabledIcon : string - the icon for "disabled" state, default "fa-square-o" * - disabledLabel : string - the label for "disabled" state, default "Disabled" ("editor:workspace.disabled") - * - class: string - additional classes to apply to the button - eg "red-ui-button-small" + * - baseClass : string - the base css class to apply, default "red-ui-button" (alternative eg "red-ui-sidebar-header-button") + * - class : string - additional classes to apply to the button - eg "red-ui-button-small" * methods: * - */ @@ -35,6 +36,7 @@ if (this.options.hasOwnProperty("invertState")) { invertState = this.options.invertState; } + var baseClass = this.options.baseClass || "red-ui-button"; var enabledIcon = this.options.enabledIcon || "fa-check-square-o"; var disabledIcon = this.options.disabledIcon || "fa-square-o"; var enabledLabel = this.options.enabledLabel || RED._("editor:workspace.enabled"); @@ -45,7 +47,7 @@ this.element.on("focus", function() { that.button.focus(); }); - this.button = $(''); + this.button = $(''); if (this.options.class) { this.button.addClass(this.options.class) } @@ -71,19 +73,13 @@ } this.button.on("click",function(e) { + e.stopPropagation(); if (that.buttonIcon.hasClass(disabledIcon)) { - that.button.addClass("selected"); - that.buttonIcon.addClass(enabledIcon); - that.buttonIcon.removeClass(disabledIcon); that.element.prop("checked",!invertState); - that.buttonLabel.text(enabledLabel); } else { - that.buttonIcon.addClass(disabledIcon); - that.button.removeClass("selected"); - that.buttonIcon.removeClass(enabledIcon); that.element.prop("checked",invertState); - that.buttonLabel.text(disabledLabel); } + that.element.trigger("change"); }) this.element.on("change", function(e) { diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js index 57fecdbf3..438f483f8 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js @@ -20,7 +20,7 @@ RED.sidebar.context = (function() { var localCache = {}; - + var flowAutoRefresh; var nodeSection; // var subflowSection; var flowSection; @@ -34,10 +34,20 @@ RED.sidebar.context = (function() { content = $("