1class PTCategoriesHandler extends elementorModules.frontend.handlers.Base { 2 getDefaultSettings() { 3 return { 4 selectors: { 5 swiper: '.swiper' 6 } 7 }; 8 } 9 10 getDefaultElements() { 11 const selectors = this.getSettings('selectors'); 12 13 return { 14 $swiperContainer: this.$element.find(selectors.swiper) 15 } 16 } 17 18 initSwiper() { 19 const elementSettings = this.getElementSettings(); 20 const elements = this.getDefaultElements(); 21 const elementorBreakpoints = elementorFrontend.config.responsive.activeBreakpoints; 22 23 if ('carousel' != elementSettings.layout) { 24 return; 25 } 26 27 const swiperOptions = { 28 slidesPerView: elementSettings.cols, 29 spaceBetween: 30, 30 loop: 'yes' === elementSettings.loop, 31 autoplay: 'yes' === elementSettings.autoplay, 32 handleElementorBreakpoints: true 33 }; 34 35 swiperOptions.breakpoints = {}; 36 37 Object.keys(elementorBreakpoints).reverse().forEach((breakpointName) => { 38 swiperOptions.breakpoints[elementorBreakpoints[breakpointName].value] = { 39 slidesPerView: +elementSettings['cols_' + breakpointName] 40 }; 41 }); 42 43 if ('yes' === elementSettings.arrows) { 44 swiperOptions.navigation = { 45 nextEl: `.elementor-element-${this.getID()} .pt-swiper-button-next`, 46 prevEl: `.elementor-element-${this.getID()} .pt-swiper-button-prev` 47 }; 48 } 49 50 if ('yes' === elementSettings.dots) { 51 swiperOptions.pagination = { 52 el: `.elementor-element-${this.getID()} .pt-swiper-pagination`, 53 type: 'bullets', 54 clickable: true 55 }; 56 } 57 58 const Swiper = elementorFrontend.utils.swiper; 59 60 this.swiper = new Swiper(elements.$swiperContainer, swiperOptions); 61 } 62 63 onInit() { 64 this.initSwiper(); 65 } 66} 67 68jQuery(window).on('elementor/frontend/init', () => { 69 elementorFrontend.elementsHandler.attachHandler('pt-categories', PTCategoriesHandler); 70});
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.