From 4ae69b99b22f50b9bc31d60126bb0dc805c7b11b Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Thu, 17 Oct 2013 15:36:09 +0200 Subject: Always create radio and checkbox with label https://fedorahosted.org/freeipa/ticket/3904 --- install/ui/less/forms-override.less | 6 ++ install/ui/src/freeipa/aci.js | 23 +++--- install/ui/src/freeipa/dns.js | 8 +- install/ui/src/freeipa/host.js | 8 +- install/ui/src/freeipa/widget.js | 145 ++++++++++++++++++++++++------------ 5 files changed, 122 insertions(+), 68 deletions(-) (limited to 'install') diff --git a/install/ui/less/forms-override.less b/install/ui/less/forms-override.less index 986a86d6f..321eac246 100644 --- a/install/ui/less/forms-override.less +++ b/install/ui/less/forms-override.less @@ -37,6 +37,12 @@ input[type="radio"] + label { background-position: center left; } +input[type="checkbox"].standalone + label, +input[type="radio"].standalone + label { + padding: 0; + width: 13px; +} + input[type="checkbox"] + label { background-image: url('../img/checkbutton-background.png'); } diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js index 1326f1b04..b848073b0 100644 --- a/install/ui/src/freeipa/aci.js +++ b/install/ui/src/freeipa/aci.js @@ -510,16 +510,17 @@ IPA.attributes_widget = function(spec) { var tr = $('').appendTo($('thead', that.table)); + var th = $('').appendTo(tr); + IPA.standalone_option({ + type: "checkbox", + click: function() { + $('.aci-attribute', that.table). + prop('checked', $(this).prop('checked')); + that.value_changed.notify([], that); + } + }, th); + tr.append($('', { - html: $('', { - type: "checkbox", - click: function() { - $('.aci-attribute', that.table). - prop('checked', $(this).prop('checked')); - that.value_changed.notify([], that); - } - }) - })).append($('', { 'class': 'aci-attribute-column', html: text.get('@i18n:objects.aci.attribute') })); @@ -545,7 +546,7 @@ IPA.attributes_widget = function(spec) { var td = $('').appendTo(tr); var name = that.get_input_name(); var id = that._option_next_id + name; - td.append($('',{ + IPA.standalone_option({ id: id, type: 'checkbox', name: name, @@ -554,7 +555,7 @@ IPA.attributes_widget = function(spec) { change: function() { that.value_changed.notify([], that); } - })); + }, td); td = $('').appendTo(tr); td.append($('