- 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
--
Petr Vobornik
From e76604f82bacf23c51c4bc8821421aaa657ea0de Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Fri, 25 Apr 2014 19:15:52 +0200
Subject: [PATCH] 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
---
 install/ui/src/freeipa/widget.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index 568696b5b7a3f74572d6102e0cfb454101bb1b7c..bb668c371857a34e7a398fc4d26df7fa05ba9361 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);
     };
-- 
1.9.0

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to