1( function( $, elementorFrontend ) { 2 3 "use strict"; 4 5 var JetWooWidgets = { 6 7 init: function() { 8 9 10 var widgets = { 11 'woo-products-widgets-products.default' : JetWooWidgets.widgetProducts, 12 'woo-products-widgets-categories.default' : JetWooWidgets.widgetCategories, 13 }; 14 15 $.each( widgets, function( widget, callback ) { 16 elementorFrontend.hooks.addAction( 'frontend/element_ready/' + widget, callback ); 17 }); 18 19 }, 20 21 widgetProducts: function ( $scope ) { 22 23 var $target = $scope.find( '.woo-products-carousel' ); 24 25 if ( ! $target.length ) { 26 return; 27 } 28 29 JetWooWidgets.initCarousel( $target.find( '.woo-products-products' ), $target.data( 'slider_options' ) ); 30 31 }, 32 33 widgetCategories: function ( $scope ) { 34 35 var $target = $scope.find( '.woo-products-carousel' ); 36 37 if ( ! $target.length ) { 38 return; 39 } 40 41 JetWooWidgets.initCarousel( $target.find( '.woo-products-categories' ), $target.data( 'slider_options' ) ); 42 43 }, 44 45 initCarousel: function( $target, options ) { 46 47 var tabletSlides, mobileSlides, defaultOptions, slickOptions; 48 49 if ( options.slidesToShow.tablet ) { 50 tabletSlides = options.slidesToShow.tablet; 51 } else { 52 tabletSlides = 1 === options.slidesToShow.desktop ? 1 : 2; 53 } 54 55 if ( options.slidesToShow.mobile ) { 56 mobileSlides = options.slidesToShow.mobile; 57 } else { 58 mobileSlides = 1; 59 } 60 61 options.slidesToShow = options.slidesToShow.desktop; 62 63 defaultOptions = { 64 customPaging: function(slider, i) { 65 return $( '<span />' ).text( i + 1 ); 66 }, 67 dotsClass: 'woo-products-slick-dots', 68 responsive: [ 69 { 70 breakpoint: 1025, 71 settings: { 72 slidesToShow: tabletSlides, 73 } 74 }, 75 { 76 breakpoint: 768, 77 settings: { 78 slidesToShow: mobileSlides, 79 slidesToScroll: 1 80 } 81 } 82 ] 83 }; 84 85 slickOptions = $.extend( {}, defaultOptions, options ); 86 87 $target.slick( slickOptions ); 88 }, 89 90 }; 91 92 $( window ).on( 'elementor/frontend/init', JetWooWidgets.init ); 93 94}( jQuery, window.elementorFrontend ) );
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.