Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

38 lignes
1.1 KiB

  1. import $ from "jquery";
  2. import IHKSwitch from "../ihk-switch/ihk-switch";
  3. class IHKCommonContent {
  4. constructor(wrapper) {
  5. this.wrapper = wrapper;
  6. this.wrapper = wrapper.addClass('initiated');
  7. wrapper.find('a.primary-light').on('click', (e) => {
  8. e.preventDefault();
  9. wrapper.addClass("hidden");
  10. });
  11. wrapper.find('a.secondary').on('click', (e) => {
  12. e.preventDefault();
  13. this.changeSwitcher(e);
  14. });
  15. }
  16. changeSwitcher() {
  17. let ihkSwitchZip = document.getElementById("ihk-switch-zip");
  18. if (ihkSwitchZip) {
  19. //hide already shown ihk switcher
  20. let ihkSwitchSep = document.getElementById("ihk-switch-step");
  21. if (ihkSwitchSep) {
  22. ihkSwitchSep.classList.add("hide");
  23. }
  24. //show ihk switcher with finder
  25. ihkSwitchZip.classList.remove("initialized");
  26. ihkSwitchZip.setAttribute("data-show-step", "");
  27. new IHKSwitch($(ihkSwitchZip));
  28. }
  29. }
  30. }
  31. export default IHKCommonContent;
  32. $('body').on('ihk-init dynamic-component-loaded gfi-dynamic-init', function () {
  33. $('.common-content:not(.initiated)').each(() => {
  34. new IHKCommonContent($(this));
  35. });
  36. });