1/*global Swiper*/ 2 3/*eslint no-undef: "error"*/ 4jQuery.noConflict(); 5jQuery(document).ready(function ($) { 6 $('.component.page-list').each(function () { 7 var component = $(this); 8 var breakpoint = 1199; 9 /** 10 * Init slider on mobile 11 */ 12 13 var mobileSlider; 14 var swiperContainer = component.find('.swiper-container').length > 0 ? component.find('.swiper-container') : component.find('.component-content'); 15 var swiperDestroyed = true; 16 var initSwiper = false; //Init slider function 17 18 function startMobileSlider() { 19 mobileSlider = new Swiper(swiperContainer, { 20 direction: 'horizontal', 21 loop: false, 22 slidesPerView: 'auto', 23 slideClass: 'item', 24 wrapperClass: 'items', 25 pagination: { 26 el: '.swiper-pagination', 27 clickable: false 28 } 29 }); 30 } //Check and init or destroy slider on resize event 31 32 33 window.addEventListener("resize", function () { 34 if (window.matchMedia("(max-width:" + breakpoint + "px)").matches && initSwiper == false) { 35 startMobileSlider(); 36 initSwiper = true; 37 swiperDestroyed = false; 38 } else { 39 if (window.matchMedia("(min-width:" + (breakpoint + 1) + "px)").matches && swiperDestroyed == false && mobileSlider) { 40 mobileSlider = null; 41 initSwiper = false;
42 swiperDestroyed = true; 43 } 44 } 45 }); //Check and init slider 46 47 if (window.matchMedia("(max-width:" + breakpoint + "px)").matches && initSwiper == false) { 48 startMobileSlider(); 49 swiperDestroyed = false; 50 initSwiper = true; 51 } 52 }); 53});
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.