summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/widget.js
diff options
context:
space:
mode:
Diffstat (limited to 'install/ui/src/freeipa/widget.js')
-rw-r--r--install/ui/src/freeipa/widget.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index d5837e7ea..252fe0208 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -406,6 +406,9 @@ IPA.input_widget = function(spec) {
*/
that.ctor_init = function() {
on(that, 'value-change', that.hide_if_empty);
+ on(that, 'readable-change', function() {
+ that.set_visible();
+ });
};
/**
@@ -641,9 +644,22 @@ IPA.input_widget = function(spec) {
if (that.has_value === false && !that.is_writable() && that.hidden_if_empty) {
visible = false;
}
+ if (that.readable !== undefined) {
+ visible = visible && that.readable;
+ }
return visible;
};
+ that.set_readable = function(readable) {
+
+ var old = that.readable;
+ that.readable = readable;
+
+ if (old !== that.readable) {
+ that.emit('readable-change', { source: that, readable: readable });
+ }
+ };
+
/**
* Widget is writable
* @return {boolean}