diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-01-18 17:58:55 -0600 |
---|---|---|
committer | Petr VobornÃk <pvoborni@redhat.com> | 2012-01-23 15:38:35 +0100 |
commit | fef343ae8f501aa67d4c746d9c7103d797fd6be2 (patch) | |
tree | f4cd5bad86ac0309dbcf3148dcdc10a8a62a0b17 /install/ui/widget.js | |
parent | 7c0c39581c567c2c5bd92f9396b6fd99a2b8a6f8 (diff) | |
download | freeipa-fef343ae8f501aa67d4c746d9c7103d797fd6be2.tar.gz freeipa-fef343ae8f501aa67d4c746d9c7103d797fd6be2.tar.xz freeipa-fef343ae8f501aa67d4c746d9c7103d797fd6be2.zip |
Show disabled entries in gray.
The users, HBAC/sudo rules, HBAC test, and SELinux list pages have
been modified to show disabled entries in gray. Icons will be added
separately.
Ticket #1996
Diffstat (limited to 'install/ui/widget.js')
-rw-r--r-- | install/ui/widget.js | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/install/ui/widget.js b/install/ui/widget.js index 4972372cb..85d9282c2 100644 --- a/install/ui/widget.js +++ b/install/ui/widget.js @@ -947,6 +947,12 @@ IPA.format = function(spec) { var that = {}; + // parse attribute value into a normalized value + that.parse = function(value) { + return value; + }; + + // format normalized value that.format = function(value) { return value; }; @@ -965,7 +971,8 @@ IPA.boolean_format = function(spec) { that.show_false = spec.show_false; that.invert_value = spec.invert_value; - that.format = function(value) { + // convert string boolean value into real boolean value, or keep the original value + that.parse = function(value) { if (value === undefined || value === null) return ''; @@ -985,7 +992,15 @@ IPA.boolean_format = function(spec) { if (typeof value === 'boolean') { if (that.invert_value) value = !value; + } + return value; + }; + + // convert boolean value into formatted string, or keep the original value + that.format = function(value) { + + if (typeof value === 'boolean') { if (value) { value = that.true_value; @@ -1035,6 +1050,7 @@ IPA.column = function (spec) { var value = record[that.name]; if (that.format) { + value = that.format.parse(value); value = that.format.format(value); } value = value ? value.toString() : ''; @@ -1482,6 +1498,16 @@ IPA.table_widget = function (spec) { that.setup_column(column, div, record); } + + return tr; + }; + + that.set_row_enabled = function(tr, enabled) { + if (enabled) { + tr.removeClass('disabled'); + } else { + tr.addClass('disabled'); + } }; that.setup_column = function(column, div, record) { |