summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2014-04-25 19:15:52 +0200
committerPetr Vobornik <pvoborni@redhat.com>2014-05-05 17:54:36 +0200
commit093c72d60e94d9545e38f2ad90cb24e6f44cbd62 (patch)
tree6a38e008c5519b9961c4d464c4c29a37c905272a
parent7eff8ad7dc385070b600ddb2b2ba1f39835718b6 (diff)
downloadfreeipa-093c72d60e94d9545e38f2ad90cb24e6f44cbd62.tar.gz
freeipa-093c72d60e94d9545e38f2ad90cb24e6f44cbd62.tar.xz
freeipa-093c72d60e94d9545e38f2ad90cb24e6f44cbd62.zip
webui: fix switching between multiple_choice_section choices
- required indicators are not present for all sections except the last - validation has wrong color for the same sections There was only one layout for all choices. Layout should not be reused because `create` method will reset layout's rows therefore it worked properly only for the last choice. https://fedorahosted.org/freeipa/ticket/4327 Reviewed-By: Adam Misnyovszki <amisnyov@redhat.com>
-rw-r--r--install/ui/src/freeipa/widget.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index 568696b5b..bb668c371 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -4534,7 +4534,7 @@ IPA.multiple_choice_section = function(spec) {
var that = IPA.composite_widget(spec);
that.choices = $.ordered_map().put_array(spec.choices, 'name');
- that.layout = IPA.build(spec.layout || IPA.fluid_layout);
+ that.layout = spec.layout || IPA.fluid_layout;
that.create = function(container) {
@@ -4563,7 +4563,7 @@ IPA.multiple_choice_section = function(spec) {
that.create_choice = function(choice) {
- var widgets, i, widget, field, section, choice_el, header, radio,
+ var widgets, i, widget, field, section, layout, choice_el, header, radio,
enabled, radio_id;
widgets = [];
@@ -4610,7 +4610,8 @@ IPA.multiple_choice_section = function(spec) {
'for': radio_id
}).appendTo(header);
- section = that.layout.create(widgets);
+ layout = IPA.build(that.layout);
+ section = layout.create(widgets);
section.appendTo(choice_el);
choice_el.appendTo(that.choice_container);
};