1class EwpeSwiperClass extends elementorModules.frontend.handlers.Base { 2 getDefaultSettings() { 3 return { 4 selectors: { 5 swiperContainer: '.ewpe-main-wrapper.swiper-container', 6 swiperWrapper: '.swiper-wrapper', 7 nextButton: '.ewpe-button-next', 8 prevButton: '.ewpe-button-prev', 9 paginationdiv: '.ewpe-carousel-pagination', 10 }, 11 }; 12 } 13 14 getDefaultElements() { 15 const selectors = this.getSettings('selectors'); 16 const { 17 swiperContainer, 18 swiperWrapper, 19 nextButton, 20 prevButton, 21 paginationdiv, 22 TopNavigation, 23 BottomNavigation 24 } = selectors; 25 return { 26 $swiperContainer: this.$element.find(swiperContainer), 27 $swiperWrapper: this.$element.find(swiperWrapper), 28 $nextButton: this.$element.find(nextButton), 29 $prevButton: this.$element.find(prevButton), 30 $paginationDiv: this.$element.find(paginationdiv), 31 $TopNavigation: this.$element.find(TopNavigation), 32 $BottomNavigation: this.$element.find(BottomNavigation), 33 }; 34 } 35 36 bindEvents() { 37 const elements = this.elements; 38 const swiperContainer = elements.$swiperContainer; 39 const nextButton = elements.$nextButton; 40 const prevButton = elements.$prevButton; 41 const paginationEl = elements.$paginationDiv; 42 const innerWrappers = swiperContainer.find('.ewpe-inner-wrapper'); 43 // Hide next and prev buttons if innerWrappers length is 0 44 if (innerWrappers.length === 0) { 45 nextButton.addClass('ewpe-nav-button-hide'); 46 prevButton.addClass('ewpe-nav-button-hide'); 47 return; // Exit early since there's no need to initialize Swiper 48 } 49 // innerWrappers.addClass('loading'); 50 let column = swiperContainer.data("column") || 2; 51 let breakpoints; 52 if (column < 2) { 53 breakpoints = { 54 320: { slidesPerView: 1 }, 55 480: { slidesPerView: 1 }, 56 768: { slidesPerView: 1 }, 57 1025: { slidesPerView: 1 }, 58 }; 59 } else { 60 breakpoints = { 61 320: { slidesPerView: 1 }, 62 480: { slidesPerView: 1 }, 63 768: { slidesPerView: 2 }, 64 1025: { slidesPerView: swiperContainer.data("column") }, 65 }; 66 } 67 const swiperConfig = { 68 spaceBetween: swiperContainer.data("slide-space"), 69 speed: swiperContainer.data("speed"), 70 autoplay: swiperContainer.data("autoplay"), 71 slidesPerGroup: swiperContainer.data("slidetoscroll"), 72 pauseOnMouseEnter: swiperContainer.data("pauseonmouse"), 73 loop: swiperContainer.data("infinite-loop"), 74 autoHeight: swiperContainer.data("slide-height"), 75 slidesPerView: swiperContainer.data("column"), 76 direction: 'horizontal', 77 navigation: { 78 nextEl: nextButton[0], 79 prevEl: prevButton[0], 80 }, 81 pagination: { 82 el: paginationEl[0], 83 clickable: true, 84 type: swiperContainer.data("pagination-type"), 85 }, 86 breakpoints: breakpoints, 87 }; 88 89 if (swiperContainer.data("effect-view") === 'center-coverflow') { 90 swiperConfig.effect = 'coverflow'; 91 swiperConfig.centeredSlides = true; 92 swiperConfig.grabCursor = true; 93 } else if (swiperContainer.data("effect-view") === 'coverflow-effect') { 94 swiperConfig.effect = 'coverflow'; 95 swiperConfig.centeredSlides = true; 96 swiperConfig.grabCursor = true; 97 swiperConfig.coverflowEffect = { 98 rotate: 0, 99 stretch: 80, 100 depth: 200, 101 modifier: 1, 102 slideShadows: false, 103 }; 104 } 105 106 if (swiperContainer.length > 0) { 107 if (typeof Swiper === 'undefined') { 108 const asyncSwiper = elementorFrontend.utils.swiper; 109 new asyncSwiper(swiperContainer[0], swiperConfig).then(newSwiperInstance => { 110 this.swiperInstance = newSwiperInstance; 111 this.swiperCheck(swiperContainer, swiperConfig); 112 swiperContainer.find('.ewpe-inner-wrapper').css('opacity', 1); 113 }); 114 } else { 115 this.swiperInstance = new Swiper(swiperContainer[0], swiperConfig); 116 this.swiperCheck(swiperContainer, swiperConfig); 117 swiperContainer.find('.ewpe-inner-wrapper').css('opacity', 1); 118 } 119 } 120 } 121 122 swiperCheck(wrapper, elementSettings) { 123 124 const swiper = this.swiperInstance; 125 if (elementSettings.pauseOnMouseEnter) { 126 wrapper.on('mouseover', () => { 127 if (swiper.autoplay) swiper.autoplay.stop(); 128 }); 129 wrapper.on('mouseout', () => { 130 if (swiper.autoplay) swiper.autoplay.start(); 131 }); 132 } 133 } 134} 135 136jQuery(window).on('elementor/frontend/init', () => { 137 const addHandler = $element => { 138 jQuery(document).ready(function($) { 139 $('.ewpe-main-wrapper.swiper-container-3d').removeClass('swiper-container-3d').addClass('swiper-3d'); 140 });
141 elementorFrontend.elementsHandler.addHandler(EwpeSwiperClass, { 142 $element, 143 }); 144 }; 145 elementorFrontend.hooks.addAction('frontend/element_ready/the-event-main.default', addHandler); 146});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.