forked from brooksbingham/theme-elegance
fix: close filters on changing page
parent
eaf7015013
commit
77430f1882
|
@ -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
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue