1/* global fgf_owl_carousel_params */ 2 3jQuery(function ($) { 4 'use strict'; 5 try { 6 7 $(document.body).on('fgf-enhanced-carousel', function ( ) { 8 9 var owl_carousels = $('.fgf-owl-carousel-items'); 10 if (!owl_carousels.length) { 11 return; 12 } 13 14 var item_count = $('.fgf-owl-carousel-item').length, 15 desktop_item_count = (item_count < fgf_owl_carousel_params.desktop_count) ? item_count : fgf_owl_carousel_params.desktop_count, 16 tablet_item_count = (item_count < fgf_owl_carousel_params.tablet_count) ? item_count : fgf_owl_carousel_params.tablet_count, 17 mobile_item_count = (item_count < fgf_owl_carousel_params.mobile_count) ? item_count : fgf_owl_carousel_params.mobile_count; 18 19 owl_carousels.each(function (e) { 20 $(this).owlCarousel({ 21 loop: true, 22 margin: parseInt(fgf_owl_carousel_params.item_margin), 23 responsiveClass: true, 24 nav: ('true' === fgf_owl_carousel_params.nav), 25 navText: [fgf_owl_carousel_params.nav_prev_text, fgf_owl_carousel_params.nav_next_text], 26 autoplay: ('true' === fgf_owl_carousel_params.auto_play), 27 dots: ('true' === fgf_owl_carousel_params.pagination), 28 slideBy: fgf_owl_carousel_params.item_per_slide, 29 autoplayTimeout: fgf_owl_carousel_params.slide_speed, 30 autoplayHoverPause: true, 31 responsive: { 32 0: { 33 items: mobile_item_count, 34 }, 35 600: { 36 items: tablet_item_count, 37 }, 38 1000: { 39 items: desktop_item_count, 40 } 41 } 42 }); 43 }); 44 }); 45 46 // Initialize carousel when cart updated. 47 $(document.body).on('updated_wc_div', function ( ) { 48 $(document.body).trigger('fgf-enhanced-carousel'); 49 }); 50 51 $(document.body).trigger('fgf-enhanced-carousel'); 52 53 } catch (err) { 54 window.console.log(err); 55 } 56 57});
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.