Fix filterbar icon status

pull/5742/merge
Aleksander Machniak 7 years ago
parent 3cb91290b5
commit a1a933cb5c

@ -1663,11 +1663,13 @@ function rcube_elastic_ui()
return value && value != 'ALL'; return value && value != 'ALL';
}, },
hide_func = function(event, focus) { hide_func = function(event, focus) {
bar[is_filter_enabled() ? 'addClass' : 'removeClass']('active');
if (button.is(':visible')) { if (button.is(':visible')) {
return; return;
} }
bar.removeClass('open')[is_filter_enabled() ? 'addClass' : 'removeClass']('active'); bar.removeClass('open');
if (focus && rcube_event.is_keyboard(event)) { if (focus && rcube_event.is_keyboard(event)) {
button.focus(); button.focus();
@ -1681,13 +1683,7 @@ function rcube_elastic_ui()
} }
select.removeClass('hidden searchfilterbar').addClass('form-control') select.removeClass('hidden searchfilterbar').addClass('form-control')
.on('change', function(e) { .on('change', function(e) { hide_func(e, true); });
hide_func(e, true);
// It may be called when the form is hidden... update status
if (is_filter_enabled()) {
bar.removeClass('active');
}
});
// Display filter selection (with animation effect) // Display filter selection (with animation effect)
button.on('click', function() { button.on('click', function() {

Loading…
Cancel
Save