Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

50 righe
1.3 KiB

  1. import $ from 'jquery';
  2. class IHKExtendedSearch {
  3. constructor(section) {
  4. this.section = section.addClass('initiated');
  5. $('#search-expand-collapse').on('click', (e) => {
  6. e.preventDefault();
  7. $(e.currentTarget).toggleClass('open');
  8. this.section.stop().slideToggle(500, 'swing');
  9. });
  10. section.find('.ev-search-btn').on('click', (e) => {
  11. e.preventDefault();
  12. console.log('click');
  13. const target = $(e.currentTarget);
  14. target.next('.ev-filter').stop().slideToggle(400, 'easeOutQuad');
  15. window.requestAnimationFrame(() => {
  16. target.toggleClass('open');
  17. })
  18. });
  19. section.find('.reset').on('click', (e) => {
  20. e.preventDefault();
  21. const form = $(e.currentTarget).closest('form');
  22. form[0].reset();
  23. form.find('.half-checked').removeClass('half-checked');
  24. $('html, body').animate({
  25. scrollTop: form.offset().top - 120
  26. }, 500, 'easeOutQuad');
  27. });
  28. /*
  29. $('.datepicker').each((i, el) => {
  30. $(el).datepicker({ changeYear: true, changeMonth: true});
  31. });
  32. */
  33. }
  34. }
  35. export default IHKExtendedSearch;
  36. $('body').on('ihk-init dynamic-component-loaded', function () {
  37. $('.extended-search:not(.initiated)').each(function (i) {
  38. new IHKExtendedSearch($(this));
  39. });
  40. });