From c2783b9b54ecae8299da0dc593c3813c2bd26fe2 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Thu, 26 Jul 2012 11:17:28 +0200 Subject: Replace use of attr with prop for booleans Recommened way of setting boolean HTML attributes is by $.prop(boolean) method not $.attr(boolean) because it sets DOM object property not an attribute. Latter works because of jquery's backward compatibility. This patch makes things clearer. Some info about prop and attr: http://stackoverflow.com/a/5876747 https://fedorahosted.org/freeipa/ticket/2817 --- install/ui/hbactest.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'install/ui/hbactest.js') diff --git a/install/ui/hbactest.js b/install/ui/hbactest.js index 373ff39b..4b666ef2 100644 --- a/install/ui/hbactest.js +++ b/install/ui/hbactest.js @@ -279,7 +279,7 @@ IPA.hbac.test_select_facet = function(spec) { that.table.set_values = function(values) { if (values && values.length && values[0] === '__external__') { - if (that.external_radio) that.external_radio.attr('checked', true); + if (that.external_radio) that.external_radio.prop('checked', true); } else { that.table.table_set_values(values); } @@ -393,7 +393,7 @@ IPA.hbac.test_select_facet = function(spec) { that.reset = function() { delete that.selected_values; - if (that.external_radio) that.external_radio.attr('checked', false); + if (that.external_radio) that.external_radio.prop('checked', false); if (that.external_text) that.external_text.val(''); }; @@ -482,8 +482,8 @@ IPA.hbac.test_rules_facet = function(spec) { that.reset = function() { delete that.selected_values; - if (that.enabled) that.enabled.attr('checked', false); - if (that.disabled) that.disabled.attr('checked', false); + if (that.enabled) that.enabled.prop('checked', false); + if (that.disabled) that.disabled.prop('checked', false); }; that.save = function(record) { @@ -655,8 +655,8 @@ IPA.hbac.test_run_facet = function(spec) { delete that.data; that.show_matched = true; that.show_unmatched = true; - if (that.matched_checkbox) that.matched_checkbox.attr('checked', true); - if (that.unmatched_checkbox) that.unmatched_checkbox.attr('checked', true); + if (that.matched_checkbox) that.matched_checkbox.prop('checked', true); + if (that.unmatched_checkbox) that.unmatched_checkbox.prop('checked', true); that.refresh(); }; -- cgit