From 04325fbb4c64ee4aef6d8c9adf0ff95b8b653101 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Fri, 22 Mar 2013 17:53:04 +0100 Subject: Nestable checkbox/radio widget New component: option_widget_base. It's not a regular widget but it share some of its characteristics. It should extend regular widget or it can be nested in itself alone. checkbox_widget, checkboxes_widget, radio_widget were modified to use it. Built as a prerequisite for: https://fedorahosted.org/freeipa/ticket/3404 --- install/ui/ipa.css | 15 ++ install/ui/src/freeipa/aci.js | 15 +- install/ui/src/freeipa/rule.js | 3 +- install/ui/src/freeipa/widget.js | 500 ++++++++++++++++++++++++++++----------- 4 files changed, 390 insertions(+), 143 deletions(-) (limited to 'install') diff --git a/install/ui/ipa.css b/install/ui/ipa.css index 71cad420..3e443d54 100644 --- a/install/ui/ipa.css +++ b/install/ui/ipa.css @@ -1294,6 +1294,21 @@ table.scrollable tbody { width: 400px; } +.option_widget { + list-style-type: none; + margin: 0; + padding: 0; +} + +.option_widget.nested { + padding-left: 40px; +} + +.option_widget.inline, +.option_widget.inline > li { + display: inline; +} + .combobox-widget-input { display: inline-block; position: relative; diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js index 383848ec..b6825d13 100644 --- a/install/ui/src/freeipa/aci.js +++ b/install/ui/src/freeipa/aci.js @@ -477,7 +477,7 @@ IPA.attributes_widget = function(spec) { 'class': 'aci-attribute-table-container' }).appendTo(container); - that.table = $('', { + that.$node = that.table = $('
', { id:id, 'class':'search-table aci-attribute-table scrollable' }). @@ -520,9 +520,12 @@ IPA.attributes_widget = function(spec) { var tr = $('').appendTo(tbody); var td = $('
').appendTo(tr); + var name = that.get_input_name(); + var id = that.option_next_id + name; td.append($('',{ + id: id, type: 'checkbox', - name: that.name, + name: name, value: value, 'class': 'aci-attribute', change: function() { @@ -531,8 +534,10 @@ IPA.attributes_widget = function(spec) { })); td = $('').appendTo(tr); td.append($('