mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-26 11:19:55 +03:00
related to #1931 Clicking outside a filter closes the openned filter
This commit is contained in:
parent
0266278561
commit
cabb080d91
1 changed files with 14 additions and 0 deletions
|
@ -25,6 +25,19 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).on('click', function (e) {
|
||||||
|
$(".filter-form").each(function () {
|
||||||
|
if ($(this).parent().hasClass("show-filter-dropdown") &&
|
||||||
|
$(this).parent().has(e.target).length === 0 &&
|
||||||
|
!$(this).parent().is(e.target)) {
|
||||||
|
$(this).parent().trigger('click');
|
||||||
|
if ($(".filter").has(e.target).length !== 0) {
|
||||||
|
$(e.target).trigger('click');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
global_params.search_id = search_id;
|
global_params.search_id = search_id;
|
||||||
|
|
||||||
if (!global_params.fields) {
|
if (!global_params.fields) {
|
||||||
|
@ -334,6 +347,7 @@ $(document).ready(function () {
|
||||||
}
|
}
|
||||||
$(".filter-tag-form").toggle(0, function () {
|
$(".filter-tag-form").toggle(0, function () {
|
||||||
if ($(this).is(':visible')) {
|
if ($(this).is(':visible')) {
|
||||||
|
$(".show-filter-dropdown").removeClass('show-filter-dropdown');
|
||||||
$(".filter-tag").addClass("show-filter-dropdown");
|
$(".filter-tag").addClass("show-filter-dropdown");
|
||||||
} else {
|
} else {
|
||||||
$(".filter-tag").removeClass("show-filter-dropdown");
|
$(".filter-tag").removeClass("show-filter-dropdown");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue