From e149174696ce0f00aaebeb92c3ffff1b299b565e Mon Sep 17 00:00:00 2001 From: bartbutenaers Date: Fri, 6 Nov 2020 08:45:50 +0100 Subject: [PATCH] Disable TypedInput --- .../editor-client/src/js/ui/common/typedInput.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js index 037e8e454..ba314c830 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js @@ -954,6 +954,18 @@ }, hide: function() { this.uiSelect.hide(); + }, + disable: function(val) { + if(val === true) { + this.uiSelect.attr("disabled", "disabled"); + } else if (val === false) { + this.uiSelect.attr("disabled", null); //remove attr + } else { + this.uiSelect.attr("disabled", val); //user value + } + }, + disabled: function() { + return this.uiSelect.attr("disabled"); } }); })(jQuery);