Home › Forums › Themes Support › Claue › Ajax Filter closing automatically
Tagged: ajax filter
- This topic has 2 replies, 2 voices, and was last updated 6 years, 7 months ago by Harry.
-
AuthorPosts
-
-
May 8, 2018 at 12:31 pm #20031
Hi,
It seems like since one of the last updates, any click that happens on the filter popup sidebar now closes the sidebar automatically, just like if we click outside of it (see screenshot).
It is a big problem since I added some functionality to the ajax filtering (ability to toggle sub categories and filters like the color), so this sidebar is now unusable.
Please advise how I can fix this, or if it comes from the Javascript that I added? Although it was working fine before.
Thanks in advance for your help, and more power to Claue!
Attachments:
You must be logged in to view attached files. -
May 8, 2018 at 1:16 pm #20034
I believe it is because you changed the handles and Javascript toggles in your core theme.
Current version is:
// Init sidebar filter
var wcInitSidebarFilter = function() {
$(document.body).click( function() {
$( ‘.jas-filter-wrap’ ).removeClass( ‘opened’ );
});$( ‘body’ ).on( ‘click’, ‘.filter-trigger’, function(e) {
e.stopPropagation();
$( ‘.jas-filter-wrap’ ).toggleClass( ‘opened’ );
$( ‘.close-filter’ ).on( ‘click’, function() {
$( ‘.jas-filter-wrap’ ).removeClass( ‘opened’ );
});
e.preventDefault();
});
}But former version that worked was
// Init sidebar filter
var wcInitSidebarFilter = function() {
$( ‘body’ ).on( ‘click’, ‘.filter-trigger’, function(e) {
$( ‘.jas-filter-wrap’ ).toggleClass( ‘opened’ );
$( ‘.close-filter’ ).on( ‘click’, function() {
$( ‘.jas-filter-wrap’ ).removeClass( ‘opened’ );
});
e.preventDefault();
});
}Since your previous version is actually best jQuery practice (as the .click event handler is deprecated in latest jQuery version) I wonder why you decided to change it at all.
As I am no jQuery expert though, could you please let me know if there’s a way for me to safely change it in my child theme to override the issue?
-
May 8, 2018 at 4:57 pm #20046
Hi,
Please update theme to latest version 1.3.3 this function change back.
Best regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio
-
-
AuthorPosts
You must be logged in to reply to this topic.