mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #2752 from bartbutenaers/readonly-typedinput
Allow TypedInput to be disabled
This commit is contained in:
commit
df1eb631e1
@ -965,6 +965,18 @@
|
|||||||
},
|
},
|
||||||
hide: function() {
|
hide: function() {
|
||||||
this.uiSelect.hide();
|
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);
|
})(jQuery);
|
||||||
|
@ -26,6 +26,14 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow:visible;
|
overflow:visible;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
&[disabled] {
|
||||||
|
input, button {
|
||||||
|
background: $secondary-background-inactive;
|
||||||
|
pointer-events: none;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.red-ui-typedInput-input-wrap {
|
.red-ui-typedInput-input-wrap {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user