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(() => {
|
$(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(() => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#product-list-top-filters').show(function() {
|
if ( !pageFilter ) {
|
||||||
checkAndShowOverlay();
|
$('#product-list-top-filters').show(function() {
|
||||||
});
|
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
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue