1jQuery.noConflict()(function($) { 2 3 "use strict"; 4 5// Compare Custom 6 var initCompareCustomFunction = function() 7 { 8 $(document).on('click', 'a.compare:not(.added)', function (e) { 9 e.preventDefault(); 10 11 var $this = $(this); 12 $this.addClass('loading'); 13 14 $this.closest('.product-inner').find('.compare:not(.loading)').trigger('click'); 15 16 var compare = false; 17 18 if ($(this).hasClass('added')) { 19 compare = true; 20 } 21 22 if (compare === false) { 23 var compare_counter = $(document).find('#top-cart-compare-count').html(); 24 compare_counter = parseInt(compare_counter, 10) + 1; 25 $this.removeClass('loading'); 26 setTimeout(function () { 27 $(document).find('#top-cart-compare-count').html(compare_counter); 28 }, 2000); 29 30 } 31 }); 32 33 $(document).find('.compare-list').on('click', '.remove a', function (e) { 34 e.preventDefault(); 35 var compare_counter = $('#top-cart-compare-count', window.parent.document).html(); 36 compare_counter = parseInt(compare_counter, 10) - 1; 37 if (compare_counter < 0) { 38 compare_counter = 0; 39 } 40 41 $('#top-cart-compare-count', window.parent.document).html(compare_counter); 42 }); 43 44 $('.yith-woocompare-widget').on('click', 'li a.remove', function (e) { 45 e.preventDefault(); 46 var compare_counter = $(document).find('#top-cart-compare-count').html(); 47 compare_counter = parseInt(compare_counter, 10) - 1; 48 if (compare_counter < 0) { 49 compare_counter = 0; 50 } 51 52 setTimeout(function () { 53 $(document).find('#top-cart-compare-count').html(compare_counter); 54 }, 2000); 55 56 }); 57 58 $('.yith-woocompare-widget').on('click', 'a.clear-all', function (e) { 59 e.preventDefault(); 60 setTimeout(function () { 61 $(document).find('#top-cart-compare-count').html('0'); 62 }, 2000); 63 }); 64 }; 65// Numbers 66 var initWooArrowsProduct = function() { 67 $('.fl-single-product .quantity, .shop_table .quantity').each(function(){ 68 var $inputNumber, min, max, $self = $(this); 69 if($self.length > 0) { 70 $self.prepend('<i class="fl-custom-icon-minus-sign-of-a-line-in-horizontal-position minus">').append('<i class="fl-custom-icon-plus-sign plus">'); 71 $self.find('.minus').on('click', function() { 72 $inputNumber = $(this).siblings('.qty'); 73 min = $inputNumber.attr('min') ? $inputNumber.attr('min') : 1; 74 max = $inputNumber.attr('max'); 75 var beforeVal = +$inputNumber.val(); 76 var newVal = (beforeVal > min || !min) ? +beforeVal - 1 : min; 77 $inputNumber.val(newVal).trigger('change'); 78 $(this).parent().siblings('.single_add_to_cart_button').attr('data-quantity', newVal); 79 }); 80 $self.find('.plus').on('click', function() { 81 $inputNumber = $(this).siblings('.qty'); 82 min = $inputNumber.attr('min') ? $inputNumber.attr('min') : 1; 83 max = $inputNumber.attr('max'); 84 var beforeVal = +$inputNumber.val(); 85 var newVal = (beforeVal < max || !max) ? +beforeVal + 1 : max; 86 $inputNumber.val(newVal).trigger('change'); 87 $(this).parent().siblings('.single_add_to_cart_button').attr('data-quantity', newVal); 88 }); 89 } 90 $self.find('.qty').on('input propertychange',function() { 91 $('.single_add_to_cart_button').attr('data-quantity', $(this).val()); 92 }); 93 }); 94 }; 95 96 97var initFilterShop = function () { 98 var counter_filter_woo = $('.fl-woocommerce-filter-sidebar div.widget').length-1; 99 $('.filter-count').text(counter_filter_woo); 100 101 102 103 104 var filter_btn = $('.fl-filter-setting'),filter_div = $('.fl-woocommerce-filter-sidebar'); 105 // Open Close 106 filter_btn.on('click',function() { 107 if ($(this).hasClass("active")){ 108 $(this).removeClass('active'); 109 } else { 110 $(this).addClass('active'); 111 } 112 113 if (filter_div.hasClass("enable")) { 114 filter_div.removeClass('enable'); 115 filter_div.addClass('disable'); 116 filter_div.slideUp(200); 117 } else { 118 filter_div.slideDown(); 119 filter_div.removeClass('disable'); 120 filter_div.addClass('enable'); 121 } 122 }); 123 124}; 125// Shop Slider Function 126var initSliderSingleShopFunction = function () { 127 128 var slider = $('.product-slider'); 129 130 slider.not('.slick-initialized').slick({
131 arrows: false, 132 dots: false, 133 infinite: false, 134 speed: 700, 135 slidesToShow: 1, 136 slidesToScroll: 1, 137 draggable: true, 138 focusOnSelect: true, 139 asNavFor: '.product-carousel' 140 }); 141 142 $('.product-carousel').not('.slick-initialized').slick({ 143 dots: false, 144 infinite: false, 145 draggable: true, 146 speed: 300, 147 slidesToShow: 4, 148 slidesToScroll: 1, 149 focusOnSelect: true, 150 arrows: false, 151 asNavFor: '.product-slider', 152 responsive: [ 153 { 154 breakpoint: 1024, 155 settings: { 156 slidesToShow: 3, 157 slidesToScroll: 1 158 } 159 }, 160 { 161 breakpoint: 600, 162 settings: { 163 slidesToShow: 2, 164 slidesToScroll: 1 165 } 166 }, 167 { 168 breakpoint: 480, 169 settings: { 170 slidesToShow: 2, 171 slidesToScroll: 1 172 } 173 } 174 ] 175 }); 176 177}; 178 179 180 181 182// Category Widget Woo 183var initProductCategoryWidgetAnimation = function () { 184 185 var $widgetWrapper = $('.widget_product_categories'); 186 187 $widgetWrapper.find('ul.product-categories li.cat-parent').first().addClass('opened'); 188 189 $widgetWrapper.find('li').each(function(){ 190 var $this = $(this); 191 if($this.length > 0) { 192 $this.prepend( "<i></i>" ); 193 } 194 }); 195 196 // open -> close sub-menu 197 function toogleWidgetSub_menu($widget_sub_menu_find) { 198 var $widget_navigation_Items = $widget_sub_menu_find.find('.cat-parent >.children >li >a,.cat-parent >.children >li'); 199 200 if (!$widget_sub_menu_find.find('.cat-parent >.children >li.opened').length) { 201 $widget_navigation_Items = $widget_sub_menu_find.find('.children >li '); 202 } 203 204 console.log($widget_navigation_Items); 205 206 TweenMax.set($widget_navigation_Items, { 207 opacity: 0, 208 x: '-20%', 209 force3D: true 210 }, 0.04); 211 if ($widget_sub_menu_find.hasClass('opened')) { 212 $widget_sub_menu_find.removeClass('opened'); 213 $widget_sub_menu_find.find('li').removeClass('opened'); 214 $widget_sub_menu_find.find('ul').slideUp(200); 215 TweenMax.staggerTo($widget_navigation_Items, 0.3, { 216 opacity: 0, 217 x: '-20%', 218 force3D: true 219 }, 0.04); 220 console.log($widget_navigation_Items); 221 } else { 222 TweenMax.staggerTo($widget_navigation_Items, 0.3, { 223 x: '0%', 224 opacity: 1, 225 delay: 0.2 226 }, 0.04); 227 228 $widget_sub_menu_find.addClass('opened'); 229 if (!$widget_sub_menu_find.children('ul').length) { 230 $widget_sub_menu_find.find('div').children('ul').slideDown(); 231 } else { 232 $widget_sub_menu_find.children('ul').slideDown(); 233 } 234 // Sub menu Children 235 $widget_sub_menu_find.siblings('li').children('ul').slideUp(200); 236 $widget_sub_menu_find.siblings('li').removeClass('opened'); 237 $widget_sub_menu_find.siblings('li').find('li').removeClass('opened'); 238 $widget_sub_menu_find.siblings('li').find('ul').slideUp(200); 239 } 240 } 241 242 $widgetWrapper.on('click', 'li.cat-parent >i', function (e) { 243 toogleWidgetSub_menu($(this).parent()); 244 e.preventDefault(); 245 }); 246}; 247 248 249 $(document).ready(function(){ 250 // Compare Custom 251 initCompareCustomFunction(); 252 // Numbers 253 initWooArrowsProduct(); 254 // Filter Shop 255 initFilterShop(); 256 // Shop Slider Function 257 initSliderSingleShopFunction(); 258 // Category Widget Woo 259 initProductCategoryWidgetAnimation(); 260 }); 261 262 $(document.body).on('updated_wc_div cart_page_refreshed',function() { 263 initWooArrowsProduct(); 264 $( document ).trigger('change input'); 265 }); 266 267});
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.