From e60cfa28626d7e224e2b4aebbe8af8e3fdf1d1c0 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Mon, 7 Jul 2014 15:38:44 +0200 Subject: [PATCH] webui: fix add of input group class The input-group class was added based on visibility of child elements. This failed when it had to be determined *before* displaying the widget. Now it's added if the buttons are not hidden by `display: none` CSS rule. Reviewed-By: Endi Sukma Dewata --- install/ui/src/freeipa/widget.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js index 302b466b5..c0c580062 100644 --- a/install/ui/src/freeipa/widget.js +++ b/install/ui/src/freeipa/widget.js @@ -834,7 +834,10 @@ IPA.text_widget = function(spec) { * visible content. */ that.update_input_group_state = function() { - var visible = $(':visible', that.input_group_btn).length > 0; + var children = that.input_group_btn.children(); + var visible = $.grep(children, function(el, i) { + return $(el).css('display') !== 'none'; + }).length > 0; that.input_group.toggleClass('input-group', visible); };