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 <edewata@redhat.com>
This commit is contained in:
Petr Vobornik 2014-07-07 15:38:44 +02:00
parent 1a904708cc
commit e60cfa2862

View File

@ -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);
};