From 9f223871a77dfb2f16680036c4662352d56e0c10 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Fri, 28 Jun 2013 14:52:11 +0200 Subject: Disable checkboxes and radios for readonly attributes https://fedorahosted.org/freeipa/ticket/3764 --- install/ui/src/freeipa/widget.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js index 53e5ae605..62a71f0a5 100644 --- a/install/ui/src/freeipa/widget.js +++ b/install/ui/src/freeipa/widget.js @@ -914,7 +914,7 @@ IPA.option_widget_base = function(spec, that) { if (option.nested) { var selected = parents_selected.indexOf(option.value) > -1; - option.widget.set_enabled(selected); + option.widget.set_enabled(selected, true); } } } @@ -958,8 +958,12 @@ IPA.option_widget_base = function(spec, that) { // uncheck all inputs check(that._selector, true /*uncheck*/); - if (values && values.length > 0) { + var writable = !that.read_only && !!that.writable; + if (!that.nested) { + that.set_enabled(writable); + } + if (values && values.length > 0) { if (that.default_on_empty && that.default_value !== null) { for (var i=0; i