1jQuery(function($){ 2 function initNowmg($root){ 3 $root.each(function(){ 4 var $widget = $(this); 5 var opts = $widget.data('opts') || {}; 6 var $inner = $widget.find('.nowmg-slick-inner'); 7 if (!$inner.length) return; 8 9 // Re-init safety for editor rerenders 10 if ($inner.hasClass('slick-initialized')) { 11 try { $inner.slick('unslick'); } catch(e){} 12 } 13 14 $inner.slick({ 15 autoplay: !!opts.autoplay, 16 autoplaySpeed: opts.autoplaySpeed || 3000, 17 arrows: !!opts.arrows, 18 dots: !!opts.dots, 19 infinite: true, 20 slidesToShow: opts.slidesToShow || 1, 21 slidesToScroll: 1, 22 responsive: [ 23 { breakpoint: 1024, settings: { slidesToShow: Math.min(opts.slidesToShow || 1, 2) } }, 24 { breakpoint: 768, settings: { slidesToShow: 1 } } 25 ] 26 }); 27 }); 28 } 29 30 // Normal pages 31 initNowmg($('.nowmg-slick')); 32 33 // Elementor editor lifecycle 34 $(window).on('elementor/frontend/init', function(){ 35 36 // 1) Initialize when our widget renders 37 elementorFrontend.hooks.addAction( 38 'frontend/element_ready/nowmg_slick_slider.default', 39 function($scope){ initNowmg($scope.find('.nowmg-slick')); } 40 ); 41 42 // 2) Fallback: global re-init (covers templates, loops, etc.) 43 elementorFrontend.hooks.addAction( 44 'frontend/element_ready/global', 45 function($scope){ initNowmg($scope.find('.nowmg-slick')); } 46 ); 47 48 // 3) If used inside Elementor Popups 49 $(document).on('elementor/popup/show', function(){ 50 initNowmg($('.nowmg-slick')); 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.