Home Forums Themes Support Claue Ajax Filter closing automatically

Tagged: 

Viewing 2 reply threads
  • Author
    Posts
    • #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.
    • #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?

    • #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

Viewing 2 reply threads

You must be logged in to reply to this topic.