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(() => { $(document).ready(() => {
let pageFilter = false;
$("#pagination-anchor.js-search-link").on('click', function() {
pageFilter = true
} )
const move = (direction) => { const move = (direction) => {
const THUMB_MARGIN = 20; const THUMB_MARGIN = 20;
const $thumbnails = $(".js-qv-product-images"); const $thumbnails = $(".js-qv-product-images");
@ -235,7 +240,10 @@ $(document).ready(() => {
$('#overlay').show(); $('#overlay').show();
}); });
$('#product-list-top-filters').show(); $("#pagination-anchor.js-search-link").on('click', function() {
pageFilter = true
} )
function checkAndShowOverlay() { function checkAndShowOverlay() {
if ($('#product-list-top-filters').is(':visible')) { if ($('#product-list-top-filters').is(':visible')) {
@ -245,15 +253,20 @@ $(document).ready(() => {
} }
} }
if ( !pageFilter ) {
$('#product-list-top-filters').show(function() { $('#product-list-top-filters').show(function() {
checkAndShowOverlay(); checkAndShowOverlay();
}); });
} else {
$('#product-list-top-filters').hide();
}
$('#overlay').on('click', function() { $('#overlay').on('click', function() {
$('#product-list-top-filters').hide(); $('#product-list-top-filters').hide();
$('#overlay').hide(); $('#overlay').hide();
}); });
pageFilter = false
$('.th-accordion').thaccordion(); $('.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"} {foreach from=$pagination.pages item="page"}
<li {if $page.current} class="current font-bold" {/if}> <li {if $page.current} class="current font-bold" {/if}>
<a <a
id="pagination-anchor"
rel="{if $page.type === 'previous'}prev{elseif $page.type === 'next'}next{else}nofollow{/if}" rel="{if $page.type === 'previous'}prev{elseif $page.type === 'next'}next{else}nofollow{/if}"
href="{$page.url}" href="{$page.url}"
disabled disabled