1/* global woodmart_settings */ 2(function($) { 3 woodmartThemeModule.$document.on('wdInstagramAjaxSuccess wdLoadDropdownsSuccess wdProductsTabsLoaded wdSearchFullScreenContentLoaded wdShopPageInit wdRecentlyViewedProductLoaded', function() { 4 woodmartThemeModule.owlCarouselInit(); 5 }); 6 7 $.each([ 8 'frontend/element_ready/wd_products.default', 9 'frontend/element_ready/wd_products_tabs.default', 10 'frontend/element_ready/wd_product_categories.default', 11 'frontend/element_ready/wd_products_brands.default', 12 'frontend/element_ready/wd_blog.default', 13 'frontend/element_ready/wd_portfolio.default', 14 'frontend/element_ready/wd_images_gallery.default', 15 'frontend/element_ready/wd_product_categories.default', 16 'frontend/element_ready/wd_banner_carousel.default', 17 'frontend/element_ready/wd_infobox_carousel.default', 18 'frontend/element_ready/wd_instagram.default', 19 'frontend/element_ready/wd_testimonials.default' 20 ], function(index, value) { 21 woodmartThemeModule.wdElementorAddAction(value, function() { 22 woodmartThemeModule.owlCarouselInit(); 23 }); 24 }); 25 26 woodmartThemeModule.owlCarouselInit = function() { 27 $('[data-owl-carousel]:not(.scroll-init):not(.wd-slider-wrapper)').each(function() { 28 owlInit($(this)); 29 }); 30 31 if (typeof ($.fn.waypoint) != 'undefined') { 32 $('[data-owl-carousel].scroll-init:not(.wd-slider-wrapper)').waypoint(function() { 33 var $this = $($(this)[0].element); 34 owlInit($this); 35 }, { 36 offset: '100%' 37 }); 38 } 39 40 function owlInit($this) { 41 var $owl = $this.find('.owl-carousel'); 42 43 if (woodmartThemeModule.windowWidth <= 1024 && $this.hasClass('disable-owl-mobile') || $owl.hasClass('owl-loaded')) { 44 return; 45 } 46 47 var options = { 48 rtl : woodmartThemeModule.$body.hasClass('rtl'), 49 items : $this.data('desktop') ? $this.data('desktop') : 1, 50 responsive : { 51 1025: { 52 items: $this.data('desktop') ? $this.data('desktop') : 1 53 }, 54 769 : { 55 items: $this.data('tablet_landscape') ? $this.data('tablet_landscape') : 1 56 }, 57 577 : { 58 items: $this.data('tablet') ? $this.data('tablet') : 1 59 }, 60 0 : { 61 items: $this.data('mobile') ? $this.data('mobile') : 1 62 } 63 }, 64 autoplay : $this.data('autoplay') === 'yes', 65 autoplayHoverPause: $this.data('autoplay') === 'yes', 66 autoplayTimeout : $this.data('speed') ? $this.data('speed') : 5000, 67 dots : $this.data('hide_pagination_control') !== 'yes', 68 nav : $this.data('hide_prev_next_buttons') !== 'yes', 69 autoHeight : $this.data('autoheight') === 'yes', 70 slideBy : typeof $this.data('scroll_per_page') !== 'undefined' ? 1 : 'page', 71 navText : false, 72 navClass : ['owl-prev wd-btn-arrow', 'owl-next wd-btn-arrow'], 73 center : $this.data('center_mode') === 'yes', 74 loop : $this.data('wrap') === 'yes', 75 dragEndSpeed : $this.data('dragendspeed') ? $this.data('dragendspeed') : 200 76 }; 77 78 if ($this.data('sliding_speed')) { 79 options.smartSpeed = $this.data('sliding_speed'); 80 options.dragEndSpeed = $this.data('sliding_speed'); 81 } 82 83 if ($this.data('animation')) { 84 options.animateOut = $this.data('animation'); 85 options.mouseDrag = true; 86 } 87 88 function determinePseudoActive() { 89 var id = $owl.find('.owl-item.active').find('.wd-slide').attr('id'); 90 var $els = $owl.find('[id="' + id + '"]'); 91 92 $owl.find('.owl-item.pseudo-active').removeClass('pseudo-active'); 93 $els.each(function() { 94 var $this = $(this); 95 96 if (!$this.parent().hasClass('active')) { 97 $this.parent().addClass('pseudo-active'); 98 } 99 }); 100 } 101 102 if ($this.data('content_animation')) { 103 determinePseudoActive(); 104 105 options.onTranslated = function() { 106 determinePseudoActive(); 107 }; 108 } 109 110 woodmartThemeModule.$window.on('vc_js', function() { 111 $owl.trigger('refresh.owl.carousel'); 112 }); 113 114 // Fix for css in files. 115 $owl.find('link').appendTo('head'); 116 117 $owl.owlCarousel(options); 118 119 if ($this.data('autoheight') === 'yes') { 120 $owl.imagesLoaded(function() { 121 $owl.trigger('refresh.owl.carousel'); 122 }); 123 } 124 } 125 }; 126 127 $(document).ready(function() { 128 woodmartThemeModule.owlCarouselInit(); 129 }); 130})(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.