fix: close filters on changing page

bug-new
jatiny 2024-11-28 11:52:29 +00:00
parent eaf7015013
commit 77430f1882
3 changed files with 34 additions and 9 deletions

View File

@ -32,6 +32,11 @@ import ProductMinitature from "./components/product-miniature";
$(document).ready(() => {
let pageFilter = false;
$("#pagination-anchor.js-search-link").on('click', function() {
pageFilter = true
} )
const move = (direction) => {
const THUMB_MARGIN = 20;
const $thumbnails = $(".js-qv-product-images");
@ -235,7 +240,10 @@ $(document).ready(() => {
$('#overlay').show();
});
$('#product-list-top-filters').show();
$("#pagination-anchor.js-search-link").on('click', function() {
pageFilter = true
} )
function checkAndShowOverlay() {
if ($('#product-list-top-filters').is(':visible')) {
@ -245,15 +253,20 @@ $(document).ready(() => {
}
}
$('#product-list-top-filters').show(function() {
checkAndShowOverlay();
});
if ( !pageFilter ) {
$('#product-list-top-filters').show(function() {
checkAndShowOverlay();
});
} else {
$('#product-list-top-filters').hide();
}
$('#overlay').on('click', function() {
$('#product-list-top-filters').hide();
$('#overlay').hide();
});
pageFilter = false
$('.th-accordion').thaccordion();

File diff suppressed because one or more lines are too long

View File

@ -36,6 +36,7 @@
{foreach from=$pagination.pages item="page"}
<li {if $page.current} class="current font-bold" {/if}>
<a
id="pagination-anchor"
rel="{if $page.type === 'previous'}prev{elseif $page.type === 'next'}next{else}nofollow{/if}"
href="{$page.url}"
disabled