Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function filter_blocks_thematique() {
  2.  
  3.         $('.section, .card-trainer').each(function (index) {
  4.  
  5.             $(this).removeClass('hidden');
  6.  
  7.             if (!$(this).hasClass(slugThematique))
  8.                 $(this).addClass('hidden');
  9.  
  10.             $(this).parent().parent().parent().prev("h2").addClass('hidden');
  11.  
  12.         });
  13.  
  14.         $('.title-filter').html("<h2>" + title_filter + "</h2>");
  15.  
  16.     }
  17.  
  18.  
  19.  
  20. var $quicksearchFilters = $('.filters-by-thematique a').click(function () {
  21.  
  22.         $('.dropdown-button.thematiques').html(default_text_thematique);
  23.  
  24.         $(this).parent().parent().parent().find('.dropdown-button').html($(this).html() + '<i class="fa fa-angle-down arrow-icon"/>');
  25.  
  26.         qsRegex = new RegExp($(this).attr('href').substr(1), 'gi');
  27.         slugThematique = $(this).attr('href').substr(1);
  28.  
  29.         title_filter = $(this).html();
  30.  
  31.         if ($(this).attr('href').substr(1) !== 'all') {
  32.             filter_blocks_thematique();
  33.         } else {
  34.             $('.section, .card-trainer').removeClass('hidden');
  35.  
  36.             $('h2').removeClass('hidden');
  37.             $('.title-filter').addClass('hidden');
  38.         }
  39.         return false;
  40.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement