mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-21 00:53:04 +02:00
fixes #1986 remove document on click
the document on click gets all click and triggers more clicks. This has been removed. Too hide a dropdown when we open another, now is specific to clicks on the filters or the filter button. We remove the class and hide the dorpdown if we have clicked on another filter
This commit is contained in:
@@ -7,28 +7,15 @@ $(document).ready(function () {
|
||||
$(this).find(".validate-text").hide();
|
||||
});
|
||||
|
||||
$(document).on('click', function (e) {
|
||||
$(".filter-form").each(function () {
|
||||
if ($(this).parent().hasClass("show-filter-dropdown")) {
|
||||
// Filter is open
|
||||
$("div.filter").on("click", function () {
|
||||
$(this).siblings().removeClass("show-filter-dropdown");
|
||||
$(this).siblings().children("div.filter-form").css('display','none');
|
||||
});
|
||||
|
||||
if ($(this).parent().has(e.target).length === 0 && !$(this).parent().is(e.target)) {
|
||||
// We don't click on a filter or filter's form
|
||||
// $(this).parent().trigger('click');
|
||||
$("div.filter-manager").on("click", function () {
|
||||
$('div.filter').children("div.filter-form").css('display','none');
|
||||
});
|
||||
|
||||
if ($("#addLinkedAlbum").has(e.target).length === 0 && !$("#addLinkedAlbum").is(e.target)) {
|
||||
console.log("We don't click in filter manager");
|
||||
$(this).parent().trigger('click');
|
||||
}
|
||||
|
||||
//if target if a filter, open it
|
||||
if ($(".filter").has(e.target).length !== 0) {
|
||||
$(e.target).trigger('click');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
global_params.search_id = search_id;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user