summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/aci.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-03-22 17:53:04 +0100
committerPetr Vobornik <pvoborni@redhat.com>2013-03-29 17:12:20 +0100
commit04325fbb4c64ee4aef6d8c9adf0ff95b8b653101 (patch)
treeea424198852f81e1b08695f93a65b2ec343b5052 /install/ui/src/freeipa/aci.js
parent5f26d2c6dbe878518963b5d8f9159ed3fcc71d58 (diff)
downloadfreeipa-04325fbb4c64ee4aef6d8c9adf0ff95b8b653101.tar.gz
freeipa-04325fbb4c64ee4aef6d8c9adf0ff95b8b653101.tar.xz
freeipa-04325fbb4c64ee4aef6d8c9adf0ff95b8b653101.zip
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
Diffstat (limited to 'install/ui/src/freeipa/aci.js')
-rw-r--r--install/ui/src/freeipa/aci.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js
index 383848ec6..b6825d136 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 = $('<table/>', {
+ that.$node = that.table = $('<table/>', {
id:id,
'class':'search-table aci-attribute-table scrollable'
}).
@@ -520,9 +520,12 @@ IPA.attributes_widget = function(spec) {
var tr = $('<tr/>').appendTo(tbody);
var td = $('<td/>').appendTo(tr);
+ var name = that.get_input_name();
+ var id = that.option_next_id + name;
td.append($('<input/>',{
+ 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 = $('<td/>').appendTo(tr);
td.append($('<label/>',{
- text: value
+ text: value,
+ 'for': id
}));
+ that.new_option_id();
}
};
@@ -553,7 +558,7 @@ IPA.attributes_widget = function(spec) {
that.populate(that.object_type);
that.append();
- that.checkboxes_update(values);
+ that.owb_update(values);
};
that.populate = function(object_type) {
@@ -567,6 +572,7 @@ IPA.attributes_widget = function(spec) {
var aciattrs = metadata.aciattrs;
+ that.options = that.prepare_options(aciattrs);
that.create_options(aciattrs);
};
@@ -585,6 +591,7 @@ IPA.attributes_widget = function(spec) {
}
if (unmatched.length > 0 && !that.skip_unmatched) {
+ that.options.push.apply(that.options, that.prepare_options(unmatched));
that.create_options(unmatched);
}
};