1(function ($) { 2 "use strict"; 3 4 const initializeBlock = function ($block) { 5 var names = []; 6 7 let slides = $block.find('.swiper-slide'); 8 9 slides.each(function (i) { 10 names.push($(this).data("name")); 11 }); 12 13 const swiper = new Swiper($block.find('.swiper')[0], { 14 autoplay: { 15 delay: 4000, 16 }, 17 speed: 1000, 18 loop: true, 19 slidesPerView: 'auto', 20 disableOnInteraction: true, 21 pagination: { 22 el: $block.find('.swiper-pagination')[0], 23 clickable: true, 24 }, 25 breakpoints: { 26 1320: { 27 loop: true, 28 centeredSlides: false, 29 pagination: { 30 el: $block.find('.swiper-pagination')[0], 31 clickable: true, 32 renderBullet: function (index, className) { 33 let label = 'Heading'; 34 if (names[index]) label = names[index]; 35 return '<span class="' + className + '"><span>' + label + '</span></span>'; 36 }, 37 }, 38 }, 39 }, 40 }); 41 42 $block.find('.swiper').mouseenter(function () { 43 swiper.autoplay.stop(); 44 }); 45 46 $block.find('.swiper').mouseleave(function () { 47 swiper.autoplay.start(); 48 }); 49 } 50 51 $(document).ready(function () { 52 $('.wp-block-custom-carousel').each(function () { 53 initializeBlock($(this)); 54 }); 55 }); 56 57 if (window.acf) { 58 window.acf.addAction('render_block_preview/type=parracatholic-carousel', initializeBlock); 59 } 60})(jQuery);
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.