1(function( $ ) { 2 "use strict"; 3 4 // Check images loaded 5 $.fn.JAS_ImagesLoaded = function( callback ) { 6 var JAS_Images = function ( src, callback ) { 7 var img = new Image; 8 img.onload = callback; 9 img.src = src; 10 } 11 var images = this.find( 'img' ).toArray().map( function( el ) { 12 return el.src; 13 }); 14 var loaded = 0; 15 $( images ).each(function( i, src ) { 16 JAS_Images( src, function() { 17 loaded++; 18 if ( loaded == images.length ) { 19 callback(); 20 } 21 }) 22 }) 23 } 24 25 // Check is mobile 26 var isMobile = function() { 27 return (/Android|iPhone|iPad|iPod|BlackBerry/i).test(navigator.userAgent || navigator.vendor || window.opera); 28 } 29 30 // Init slick carousel 31 var initCarousel = function() { 32 $( '.jas-carousel' ).not( '.slick-initialized' ).slick(); 33 34 // Reset the index of image on product variation 35 $( 'body' ).on( 'found_variation', '.variations_form', function( ev, variation ) { 36 if ( variation && variation.image && variation.image.src && variation.image.src.length > 1 ) { 37 var exist = $('.p-thumb .p-item img[data-large_image="'+variation.image.full_src+'"]'); 38 if (exist.length > 0) { 39 var index = exist.parents('.p-item').attr('data-slick-index'); 40 $( '.jas-carousel' ).slick( 'slickGoTo', index); 41 } 42 wcInitImageZoom(); 43 } 44 }); 45 } 46 47 // Init masonry layout 48 var initMasonry = function() { 49 var el = $( '.jas-masonry' ); 50 51 el.each( function( i, val ) { 52 var _option = $.parseJSON($( this ).attr( 'data-masonry' )); 53 54 if ( _option !== undefined ) { 55 var _selector = _option.selector, 56 _width = _option.columnWidth, 57 _layout = _option.layoutMode, 58 _rtl = _option.rtl; 59 60 $( this ).imagesLoaded( function() { 61 $( val ).isotope( { 62 layoutMode : _layout, 63 itemSelector: _selector, 64 percentPosition: true, 65 isOriginLeft: _rtl, 66 masonry: { 67 columnWidth: _width 68 } 69 } ); 70 setTimeout(function(){ 71 $( val ).isotope('layout'); 72 }, 200); 73 }); 74 75 $( '.jas-filter a' ).click( function() { 76 var selector = $( this ).data( 'filter' ), 77 parent = $( this ).parents( '.jas-filter' ); 78 79 $( val ).isotope({ filter: selector }); 80 81 // don't proceed if already selected 82 if ( $( this ).hasClass( 'selected' ) ) { 83 return false; 84 } 85 86 parent.find( '.selected' ).removeClass( 'selected' ); 87 $( this ).addClass( 'selected' ); 88 89 return false; 90 }); 91 } 92 }); 93 } 94 95 // Initialize search form in header. 96 var initSearchForm = function() { 97 var HS = $( '.header__search' ); 98 99 // Open search form 100 $( '.sf-open' ).on( 'click', function( e ) { 101 e.preventDefault(); 102 HS.fadeIn(); 103 HS.find( 'input[type="text"]' ).focus(); 104 }); 105 $( '#sf-close' ).on( 'click', function( e ) { 106 e.preventDefault(); 107 HS.fadeOut(); 108 }); 109 } 110 111 // Init push on header 112 var initPushMenu = function() { 113 $( 'a.jas-push-menu-btn' ).on( 'click', function (e) { 114 e.preventDefault(); 115 var mask = '<div class="mask-overlay">'; 116 117 $( 'body' ).toggleClass( 'menu-opened' ); 118 $(mask).hide().appendTo( 'body' ).fadeIn( 'fast' ); 119 $( '.mask-overlay, .close-menu' ).on( 'click', function() { 120 $( 'body' ).removeClass( 'menu-opened' ); 121 $( '.mask-overlay' ).remove(); 122 }); 123 }); 124 } 125 126 // Accordion mobile menu 127 var initDropdownMenu = function() { 128 $( '#jas-mobile-menu ul li.has-sub' ).append( '<span class="holder"></span>' ); 129 $( 'body' ).on('click','.holder',function() { 130 var el = $( this ).closest( 'li' ); 131 if ( el.hasClass( 'open' ) ) { 132 el.removeClass( 'open' ); 133 el.find( 'li' ).removeClass( 'open' ); 134 el.find( 'ul' ).slideUp(); 135 } else { 136 el.addClass( 'open' ); 137 el.children( 'ul' ).slideDown(); 138 el.siblings( 'li' ).children( 'ul' ).slideUp(); 139 el.siblings( 'li' ).removeClass( 'open' ); 140 el.siblings( 'li' ).find( 'li' ).removeClass( 'open' ); 141 el.siblings( 'li' ).find( 'ul' ).slideUp(); 142 } 143 }); 144 } 145 146 // Sticky menu 147 var initStickyMenu = function() { 148 if ( JAS_Data_Js != undefined && JAS_Data_Js[ 'header_sticky' ] ) { 149 var header = document.getElementById( 'jas-header' ), 150 headerMid = document.getElementsByClassName( 'header__mid' )[0], 151 headerMidHeight = $( '.header__mid' ).outerHeight(), 152 headerTopHeight = $( '.header__top' ).outerHeight(), 153 //headerBotHeight = $( '.header__bot' ).outerHeight(), 154 headerHeight = headerMidHeight + headerTopHeight, 155 adminBar = $( '.admin-bar' ).length ? $( '#wpadminbar' ).height() : 0; 156 157 if ( headerMid == undefined ) return; 158
159 header.setAttribute( 'style', 'height:' + headerHeight + 'px' ); 160 161 $( window ).scroll( function() { 162 if ( $( this ).scrollTop() > headerTopHeight ) { 163 header.classList.add( 'header-sticky' ); 164 headerMid.setAttribute( 'style', 'position: fixed;top:' + adminBar + 'px' ); 165 } else { 166 header.classList.remove( 'header-sticky' ); 167 headerMid.removeAttribute( 'style' ); 168 } 169 }); 170 } 171 } 172 173 // Init right to left menu 174 var initRTLMenu = function() { 175 var menu = $( '.sub-menu li' ), subMenu = menu.find( ' > .sub-menu'); 176 menu.on( 'mouseenter', function () { 177 if ( subMenu.length ) { 178 if ( subMenu.outerWidth() > ( $( window ).outerWidth() - subMenu.offset().left ) ) { 179 subMenu.addClass( 'rtl-menu' ); 180 } 181 } 182 }); 183 } 184 185 // Initialize WC quantity adjust. 186 var wcQuantityAdjust = function() { 187 $( '.quantity .input-text' ).keyup(function() { 188 var $button = $( this ).parent().next().next(), 189 $max = parseInt($(this).attr( 'max' )), 190 $val = parseInt($( this ).val()); 191 if ($val <= $max) { 192 $button.attr( 'data-quantity', $val ); 193 } 194 }); 195 $( 'body' ).on( 'click', '.quantity .plus', function( e ) { 196 var $input = $( this ).parent().parent().find( 'input.input-text' ), 197 $quantity = parseInt( $input.attr( 'max' ) ), 198 $step = parseInt( $input.attr( 'step' ) ), 199 $val = parseInt( $input.val() ), 200 $button = $( this ).parent().parent().next().next(); 201 if ( ( $quantity !== '' ) && ( $quantity <= $val + $step ) ) { 202 $( '.quantity .plus' ).css( 'pointer-events', 'none' ); 203 } 204 if ($val + $step > $quantity) return; 205 $input.val( $val + $step ); 206 207 $input.trigger( 'change' ); 208 if ( $( '.btn-atc' ).hasClass( 'atc-popup' ) ) { 209 $button.attr( 'data-quantity', $val + $step ); 210 } 211 }); 212 $( 'body' ).on( 'click', '.quantity .minus', function( e ) { 213 var $input = $( this ).parent().parent().find( 'input.input-text' ), 214 $step = parseInt( $input.attr( 'step' ) ), 215 $val = parseInt( $input.val() ) - $step, 216 $group = $(this).parents('form'), 217 $button = $( this ).parent().parent().next().next(); 218 219 if ($group.hasClass('grouped_form')) { 220 if ( $val <= 0 ) $val = 0; 221 } else { 222 if ( $val < $step ) $val = $step; 223 } 224 225 226 $input.val( $val ); 227 228 $( '.quantity .plus' ).removeAttr( 'style' ); 229 230 $input.trigger( 'change' ); 231 if ( $( '.btn-atc' ).hasClass( 'atc-popup' ) ) { 232 $button.attr( 'data-quantity', $val ); 233 } 234 }); 235 } 236 237 // Back to top button 238 var backToTop = function() { 239 var el = $( '#jas-backtop' ); 240 $( window ).scroll(function() { 241 if( $( this ).scrollTop() > $( window ).height() ) { 242 el.show(); 243 } else { 244 el.hide(); 245 } 246 }); 247 el.click( function() { 248 $( 'body,html' ).animate({ 249 scrollTop: 0 250 }, 500); 251 return false; 252 }); 253 } 254 255 // Init Magnific Popup 256 var initMagnificPopup = function() { 257 if ( $( '.jas-magnific-image' ).length > 0 ) { 258 $( '.jas-magnific-image' ).magnificPopup({ 259 type: 'image', 260 image: { 261 verticalFit: true 262 }, 263 mainClass: 'mfp-fade', 264 removalDelay: 800, 265 callbacks: { 266 beforeOpen: function() { 267 $( '#jas-wrapper' ).after( '<div class="loader"><div class="loader-inner"></div></div>' ); 268 }, 269 open: function() { 270 $( '.loader' ).remove(); 271 }, 272 } 273 }); 274 } 275 } 276 277 // Product quick view 278 window._inQuickview = false; 279 var initQuickView = function() { 280 $( 'body' ).on( 'click', '.btn-quickview', function(e) { 281 var _this = $( this ), 282 id = _this.attr( 'data-prod' ), 283 data = { action: 'jas_quickview', product: id }; 284 285 $( '#jas-wrapper' ).after( '<div class="loader"><div class="loader-inner"></div></div>' ); 286 287 $.post( JASAjaxURL, data, function( response ) { 288 $.magnificPopup.open({ 289 items: { 290 src: response, 291 type: 'inline', 292 }, 293 mainClass: 'mfp-fade', 294 removalDelay: 800 295 }); 296 297 setTimeout(function() { 298 if ( $( '.product-quickview form' ).hasClass( 'variations_form' ) ) { 299 $( '.product-quickview form.variations_form' ).wc_variation_form(); 300 $( '.product-quickview select' ).trigger( 'change' ); 301 } 302 }, 100); 303 if ( $( '.wpa-wcpb-list' ).length > 0 && window._inQuickview ) { 304 setTimeout(function() { 305 $.PLT.main_product_variation_select(); 306 $.PLT.main_product_variation_load_default(); 307 $.PLT.product_bundle_variation_select(); 308 wpa_wcpb_onchange_input_check_total_discount(); 309 310 }, 1000); 311 } 312 $( '.loader' ).remove(); 313 314 initCarousel(); 315 316 $( '.images' ).imagesLoaded( function() { 317 var imgHeight = $( '.product-quickview .images' ).outerHeight(); 318 319 $( '.product-quickview .jas-row > div' ).css({ 320 'height': imgHeight 321 }); 322 }); 323 }); 324 e.preventDefault(); 325 e.stopPropagation(); 326 window._inQuickview = true; 327 }); 328 } 329 330 // Extra content on single product ( Help & Shipping - Return ) 331 var wcExtraContent = function() { 332 $( 'body' ).on( 'click', '.jas-wc-help', function(e) { 333 $( '#jas-wrapper' ).after( '<div class="loader"><div class="loader-inner"></div></div>' ); 334 335 var data = { action: 'jas_shipping_return' } 336
337 $.post( JASAjaxURL, data, function( response ) { 338 $.magnificPopup.open({ 339 items: { 340 src: response 341 }, 342 }); 343 $( '.loader' ).remove(); 344 }); 345 e.preventDefault(); 346 e.stopPropagation(); 347 }); 348 } 349 350 // Init mini cart on header 351 var initMiniCart = function() { 352 $( 'body' ).on( 'click', '.jas-icon-cart > a', function (e) { 353 e.preventDefault(); 354 var mask = '<div class="mask-overlay">'; 355 356 $( 'body' ).toggleClass( 'cart-opened' ); 357 $( mask ).hide().appendTo( 'body' ).fadeIn( 'fast' ); 358 $( '.mask-overlay, .close-cart' ).on( 'click', function() { 359 $( 'body' ).removeClass( 'cart-opened' ); 360 $( '.mask-overlay' ).remove(); 361 }); 362 363 $( 'body' ).removeClass( 'popup-opened' ); 364 }); 365 } 366 367 // Refesh mini cart on ajax event 368 var refreshMiniCart = function( openCart ) { 369 openCart = openCart ? true : false; 370 $.ajax({ 371 type: 'POST', 372 url: JASAjaxURL, 373 dataType: 'json', 374 data: { action: 'load_mini_cart' }, 375 success: function( data ) { 376 if ( data.message != null && $( data.message.error ).length > 0 ) { 377 $( 'body' ).append( '<div class="woocommerce-error">' + data.message.error + '</div>' ); 378 $( '.woocommerce-message' ).remove(); 379 } else { 380 var cartContent = $( '.jas-mini-cart .widget_shopping_cart_content' ); 381 if ( data.cart_html.length > 0 ) { 382 cartContent.html( data.cart_html ); 383 } 384 385 $( '.jas-icon-cart .count' ).text( data.cart_total ); 386 if (openCart) { 387 var mask = '<div class="mask-overlay">'; 388 389 $( 'body' ).addClass( 'cart-opened' ); 390 $( mask ).hide().appendTo( 'body' ).fadeIn( 'fast' ); 391 $( '.mask-overlay, .close-cart' ).on( 'click', function() { 392 $( 'body' ).removeClass( 'cart-opened' ); 393 $( '.mask-overlay' ).remove(); 394 }); 395 } 396 } 397 } 398 }); 399 } 400 401 // Trigger add to cart button 402 var initAddToCart = function() { 403 var _input = $( '.quantity input' ), _quantity = _input.attr( 'max' ); 404 405 if ( _quantity != '' ) { 406 _input.bind( 'keyup mouseup change click', function () { 407 if ( parseInt( $( this ).val() ) > parseInt( _quantity ) ) { 408 $( '.single_add_to_cart_button' ).addClass( 'disabled' ); 409 } else { 410 $( '.single_add_to_cart_button' ).removeClass( 'disabled' ); 411 } 412 }); 413 } 414 415 // Single add to cart button 416 $( 'body' ).on( 'click', '.atc-slide .single_add_to_cart_button', function() { 417 var _this = $( this ), _form = _this.parents( 'form' ); 418 if ( _this.hasClass( 'disabled' ) || $( '.btn-atc' ).hasClass( 'no-ajax' ) ) return; 419 420 $.ajax({ 421 type: 'POST', 422 url: JASSiteURL + "?wc-ajax=jas-ajax", 423 dataType: 'html', 424 data: _form.serialize(), 425 cache: false, 426 headers: { 'cache-control': 'no-cache' }, 427 beforeSend: function() { 428 _this.append( '<i class="fa fa-spinner fa-pulse pa"></i>' ); 429 }, 430 success:function() { 431 setTimeout( function() { 432 $( '.fa-spinner' ).remove(); 433 }, 480) 434 } 435 }); 436 437 return false; 438 }); 439 440 // Product bundle add to cart button 441 $( 'body' ).on( 'click', '.wpa_wcpb_add_to_cart', function() { 442 var _this = $( this ), _form = _this.parents( 'form' ); 443 if ( _this.hasClass( 'disabled' ) ) return; 444 445 $.ajax({ 446 type: 'POST', 447 url: JASSiteURL + "?wc-ajax=jas-ajax", 448 dataType: 'html', 449 data: _form.serialize(), 450 cache: false, 451 headers: { 'cache-control': 'no-cache' }, 452 beforeSend: function() { 453 _this.append( '<i class="fa fa-spinner fa-pulse pa"></i>' ); 454 }, 455 success:function() { 456 setTimeout( function() { 457 $( '.fa-spinner' ).remove(); 458 }, 480) 459 } 460 }); 461 462 return false; 463 }); 464 465 if ( $( '.cart-moved' ).length > 0 ) { 466 $( '.btn-atc' ).appendTo( '.cart-moved' ); 467 } 468 } 469 470 // Switch wc currency 471 var initSwitchCurrency = function() { 472 $( 'body' ).on( 'click', '.currency-item', function() { 473 var currency = $( this ).data( 'currency' ); 474 $.cookie( 'jas_currency', currency, { path: '/' }); 475 location.reload(); 476 $( document.body ).trigger( 'wc_fragment_refresh' ); 477 }); 478 } 479 480 // Open video in popup 481 var wcInitPopupVideo = function() { 482 $(document).on('click', '.p-video .jas-popup-url', function(event){ 483 event.preventDefault(); 484 $.magnificPopup.open({ 485 disableOn: 0, 486 items: { 487 src: $(this).attr('href') 488 }, 489 type: 'iframe' 490 }); 491 }); 492 $(document).on('click', '.p-video .jas-popup-mp4', function(event){ 493 event.preventDefault(); 494 $.magnificPopup.open({ 495 disableOn: 0, 496 items: { 497 src: $(this).attr('href') 498 }, 499 type: 'inline' 500 }); 501 }); 502 } 503 504 // Init ajax search 505 var wcLiveSearch = function() { 506 if ( ! $.fn.autocomplete || ( $( '.jas-ajax-search' ).length === 0 ) ) return; 507 508 $( '.jas-ajax-search' ).autocomplete({ 509 source: function( request, response ) { 510 $.ajax({ 511 url: JASAjaxURL , 512 dataType: 'json', 513 data: { 514 key: request.term, 515 action: 'jas_claue_live_search' 516 }, 517 success: function( data ) { 518 response( data ); 519 } 520 }); 521 }, 522 minLength: 2, 523 select: function( event, ui ) { 524 window.location = ui.item.url; 525 }, 526 open: function() { 527 $( this ).removeClass( 'ui-corner-all' ).addClass( 'ui-corner-top' ); 528 }, 529 close: function() { 530 $( this ).removeClass( 'ui-corner-top' ).addClass( 'ui-corner-all' ); 531 } 532 }).data( 'ui-autocomplete' )._renderItem = function( ul, item ) { 533 return $( '<li class="oh mt__10 pt__10">' ) 534 .data( 'ui-autocomplete-item', item ) 535 .attr( 'data-url', item.url ) 536 .append( "<img class='ajax-result-item fl' src='" + item.thumb + "'><div class='oh pl__15'><a class='ajax-result-item-name' href='" + item.url + "'>" + item.label + "</a><p>" + item.except + "</p></div>" ) 537 .appendTo( ul ); 538 }; 539 } 540 541 // init ajax load 542 var initAjaxLoad = function() { 543 var button = $( '.jas-ajax-load' ); 544 545 button.each( function( i, val ) { 546 var _option = $( this ).data( 'load-more' ); 547 548 if ( _option !== undefined ) { 549 var page = _option.page, 550 container = _option.container, 551 layout = _option.layout, 552 isLoading = false, 553 anchor = $( val ).find( 'a' ), 554 next = $( anchor ).attr( 'href' ), 555 i = 2; 556 557 if ( layout == 'loadmore' ) { 558 $( val ).on( 'click', 'a', function( e ) { 559 e.preventDefault(); 560 anchor = $( val ).find( 'a' ); 561 next = $( anchor ).attr( 'href' ); 562 isLoading = true; 563 $( anchor ).html( '<i class="fa fa-circle-o-notch fa-spin"></i>' ); 564 if (isLoading) { 565 getData(); 566 } 567 }); 568 } else { 569 var animationFrame = function() { 570 anchor = $( val ).find( 'a' ); 571 next = $( anchor ).attr( 'href' ); 572 573 var bottomOffset = $( '.' + container ).offset().top + $( '.' + container ).height() - $( window ).scrollTop(); 574 575 if ( bottomOffset < window.innerHeight && bottomOffset > 0 && ! isLoading ) { 576 if ( ! next ) 577 return; 578 isLoading = true; 579 $( anchor ).html( '<i class="fa fa-circle-o-notch fa-spin"></i>' ); 580 581 getData(); 582 } 583 } 584 585 var scrollHandler = function() { 586 requestAnimationFrame( animationFrame ); 587 }; 588 589 $( window ).scroll( scrollHandler ); 590 } 591 592 var getData = function() { 593 $.get( next + '', function( data ) { 594 var content = $( '.' + container, data ).wrapInner( '' ).html(), 595 newElement = $( '.' + container, data ).find( '.portfolio-item, .product' ), 596 typeColumn = container == 'portfolios' ? 'portfolio-column' : 'wc-column', 597 col = $('.wc-col-switch a.active').length ? $('.wc-col-switch a.active').data('col') : JAS_Data_Js[typeColumn]; 598 newElement = newElement.removeClass( 'jas-col-md-2 jas-col-md-3 jas-col-md-4 jas-col-md-6' ).addClass( 'jas-col-md-' + col ); 599 $( content ).imagesLoaded( function() { 600 next = $( anchor, data ).attr( 'href' ); 601 $( '.' + container ).append( newElement ).isotope( 'appended', newElement ).isotope('layout'); 602 }); 603 604 $( anchor ).text( JAS_Data_Js['load_more'] ); 605 606 if ( page > i ) { 607 if ( JAS_Data_Js != undefined && JAS_Data_Js[ 'permalink' ] == 'plain' ) { 608 var link = next.replace( /paged=+[0-9]+/gi, 'paged=' + ( i + 1 ) ); 609 } else { 610 var link = next.replace( 'page/' + i, 'page/' + ( i + 1 ) ); 611 } 612 613 $( anchor ).attr( 'href', link ); 614 } else { 615 $( anchor ).text( JAS_Data_Js['no_more_item'] ); 616 $( anchor ).removeAttr( 'href' ).addClass( 'disabled' ); 617 } 618 isLoading = false;
619 i++; 620 }); 621 } 622 } 623 }); 624 625 if ( $( '.yith-wcan' ).length > 0 && button.length > 0 ) { 626 $( 'body' ).on( 'click', '.yith-wcan a', function() { 627 $( document ).ajaxComplete(function() { 628 window.location.reload(); 629 }); 630 }); 631 } 632 } 633 634 // Init Scroll Reveal 635 var initScrollReveal = function() { 636 window.sr = ScrollReveal().reveal( '.jas-animated', { 637 duration: 700 638 }); 639 } 640 641 // Init Countdown 642 function initCountdown() { 643 var $el = $( '.jas-countdown' ); 644 645 $el.each( function( i, val ) { 646 var _option = $( this ).data( 'time' ); 647 648 if ( _option !== undefined ) { 649 var _day = _option.day, 650 _month = _option.month, 651 _year = _option.year, 652 _end = _month + ' ' + _day + ', ' + _year + ' 00:00:00'; 653 654 $( val ).countdown( { 655 date: _end, 656 render: function(data) { 657 $( this.$el ).html("<div class='pr'><span class='db cw fs__16 mt__10'>" + this.leadingZeros(data.days, 2) + "</span><span class='db'>" + JAS_Data_Js['days'] + "</span></div><div class='pr'><span class='db cw fs__16 mt__10'>" + this.leadingZeros(data.hours, 2) + "</span><span class='db'>" + JAS_Data_Js['hrs'] + "</span></div><div class='pr'><span class='db cw fs__16 mt__10'>" + this.leadingZeros(data.min, 2) + "</span><span class='db'>" + JAS_Data_Js['mins'] + "</span></div><div class='pr'><span class='db cw fs__16 mt__10'>" + this.leadingZeros(data.sec, 2) + "</span><span class='db'>" + JAS_Data_Js['secs'] + "</span></div>"); 658 } 659 }); 660 } 661 }); 662 } 663 664 // Init wc switch layout 665 var wcInitSwitchLayout = function() { 666 $( 'body' ).on( 'click', '.wc-col-switch a', function(e) { 667 e.preventDefault(); 668 669 var _this = $( this ), 670 _col = _this.data( 'col' ), 671 _parent = _this.closest( '.wc-col-switch' ), 672 _products = $( '.products .product' ), 673 _sizer = $( '.products .grid-sizer' ); 674 675 if ( _this.hasClass( 'active' ) ) { 676 return; 677 } 678 679 _parent.find( 'a' ).removeClass( 'active' ); 680 _this.addClass( 'active' ); 681 682 _products.removeClass( 'jas-col-md-2 jas-col-md-3 jas-col-md-4 jas-col-md-6' ).addClass( 'jas-col-md-' + _col ); 683 _sizer.removeClass( 'size-2 size-3 size-4 size-6 size-12' ).addClass( 'size-' + _col ) 684 685 if ( $( '.products' ).hasClass( 'jas-masonry' ) ) { 686 initMasonry(); 687 } 688 }); 689 } 690 691 // Init sidebar filter 692 var wcInitSidebarFilter = function() { 693 $( 'body' ).on( 'click', '.filter-trigger', function(e) { 694 $( '.jas-filter-wrap' ).toggleClass( 'opened' ); 695 $( '.close-filter' ).on( 'click', function() { 696 $( '.jas-filter-wrap' ).removeClass( 'opened' ); 697 }); 698 e.preventDefault(); 699 }); 700 } 701 702 // Init sidebar filter 703 var wcTopSidebarMenu = function() { 704 $( 'body' ).on( 'click', '.jas-mobile .shop-top-sidebar .cat-parent > a', function(e) { 705 $( this ).parent().toggleClass( 'opened' ); 706 e.preventDefault(); 707 }); 708 } 709 710 // Init product accordion 711 function wcAccordion() { 712 $( '.wc-accordions .tab-heading' ).click( function( e ) { 713 e.preventDefault(); 714 715 var _this = $( this ); 716 var parent = _this.closest( '.wc-accordion' ); 717 var parent_top = _this.closest( '.wc-accordions' ); 718 719 if ( parent.hasClass( 'active' ) ) { 720 parent.removeClass( 'active' ); 721 parent.find( '.entry-content' ).stop( true, true ).slideUp(); 722 } else { 723 parent_top.find( '.wc-accordion' ).removeClass( 'active' ); 724 parent.addClass( 'active' ); 725 parent_top.find( '.entry-content' ).stop( true, true ).slideUp(); 726 parent.find( '.entry-content' ).stop( true, true ).slideDown(); 727 } 728 } ); 729 } 730 731 // Sticky sidebar for single product layout 3, 4 732 function wcStickySidebar() { 733 if ( $( '.jas-sidebar-sticky' ).length > 0 && ! isMobile() ) { 734 $( '.jas-sidebar-sticky' ).stick_in_parent(); 735 } 736 } 737 738 // Init prettyPhoto for WC 3.0 739 function initPrettyPhoto() { 740 if ( typeof $.fn.prettyPhoto == "function" ) { 741 $( 'a.zoom' ).prettyPhoto({ 742 hook: 'data-rel', 743 social_tools: false, 744 theme: 'pp_woocommerce', 745 horizontal_padding: 20, 746 opacity: 0.8, 747 deeplinking: false 748 }); 749 $( 'a[data-rel^="prettyPhoto"]' ).prettyPhoto({ 750 hook: 'data-rel', 751 social_tools: false, 752 theme: 'pp_woocommerce', 753 horizontal_padding: 20, 754 opacity: 0.8, 755 deeplinking: false 756 }); 757 } 758 } 759 760 // Init openswatch update images 761 function initOpenswatch() { 762 $( document.body ).off( 'openswatch_update_images' ).bind( 'openswatch_update_images',function( event, data ) { 763 var data_html = data.html; 764 var productId = data.productId; 765 766 $( '#product-' + productId + ' .single-product-thumbnail' ).html( data_html ); 767 768 setTimeout(function() { 769 initCarousel(); 770 initPrettyPhoto(); 771 }, 10 ); 772 }); 773 $( 'body' ).on( 'click', '.product-list-color-swatch a', function() { 774 var src = $( this ).data( 'thumb' ); 775 if ( src != '' ) { 776 $( this ).closest( '.product' ).find( 'img.wp-post-image' ).first().attr( 'src', src ); 777 $( this ).closest( '.product' ).find( 'img.wp-post-image' ).first().attr( 'srcset', src ); 778 } 779 }); 780 } 781 782 // Sticky add to cart function 783 var wcStickyAddtocart = function() { 784 var cart_button = $( '.jas-wc-single .single_add_to_cart_button' ), 785 sticky_dom = $( '.jas-sticky-atc' ); 786 787 if ( cart_button.length == 0 || sticky_dom == 0 ) 788 return; 789 790 var footer = $( '#jas-footer' ), 791 cart_button = $( '.jas-wc-single .single_add_to_cart_button' ), 792 adminBar = $( '.admin-bar' ).length ? $( '#wpadminbar' ).height() : 0, 793 cartTop = cart_button.offset().top + cart_button.height() - adminBar, 794 fh = footer.height(), 795 wh = $( window ).height(), 796 dh = $( document ).height(), 797 ww = $( window ).width(); 798 799 var AddtocartFrame = function() { 800 var scrollTop = $( window ).scrollTop(), 801 max = footer.offset().top - sticky_dom.height() - 15, 802 top = max - scrollTop; 803 804 if ( scrollTop > cartTop ) { 805 sticky_dom.slideDown(); 806 } else { 807 sticky_dom.slideUp(); 808 } 809 810 if ( scrollTop + wh < dh - fh ) { 811 sticky_dom.css({ 812 'top': 'auto', 813 'bottom': ( ww > 480 ) ? 10 : 0 814 } ); 815 } else { 816 sticky_dom.css( { 817 'bottom': 'auto', 818 'top': top 819 } ); 820 } 821 }; 822 823 var AddtocartScroll = function() { 824 requestAnimationFrame( AddtocartFrame ); 825 }; 826 827 $( window ).scroll( AddtocartScroll ); 828 829 $( 'body' ).on( 'click', '.jas-sticky-atc .button.disabled', function( e ) { 830 e.preventDefault(); 831 $( 'html, body' ).animate({ 832 scrollTop: $( 'form.variations_form' ).offset().top - adminBar 833 }, 800 ); 834 }); 835 836 $( '.btn-atc .variations_form select' ).on( 'change', function() { 837 var attr_name = $( this ).attr( 'id' ),
838 selected = $( this ).val(), 839 select_stick = $( '.jas-sticky-atc .variations_form select#' + attr_name ); 840 841 select_stick.val( selected ).change(); 842 }); 843 } 844 845 // Preloader 846 function initPreLoader() { 847 var loader = $( '.preloader' ); 848 849 if ( loader.length ) { 850 $( window ).on( 'pageshow', function( event ) { 851 if ( event.originalEvent != undefined && event.originalEvent.persisted ) { 852 loader.fadeIn( 500, function() { 853 loader.hide(); 854 loader.children().hide(); 855 }); 856 } 857 }); 858 859 $( window ).on( 'beforeunload', function() { 860 loader.fadeIn( 500, function() { 861 loader.children().fadeIn( 100 ) 862 }); 863 }); 864 865 loader.fadeOut( 800 ); 866 loader.children().fadeOut(); 867 } 868 } 869 870 // Custom 3rd-party plugin 871 function customThirdParties() { 872 // Reinit carousel on VC tabs 873 $( 'body' ).on( 'click', '.vc_tta-panel-title a', function( e ) { 874 if ( $( '.jas-carousel' ).length > 0 ) { 875 $( '.jas-carousel' ).slick( 'unslick' ); 876 877 setTimeout( function() { 878 $( '.jas-carousel' ).not( '.slick-initialized' ).slick(); 879 }, 50); 880 } 881 }); 882 883 /** 884 * Sets product images for the chosen variation 885 */ 886 $.fn.wc_variations_image_update = function( variation ) { 887 var $form = this, 888 $product = $form.closest( '.product' ), 889 $product_gallery = $product.find( '.images' ), 890 $gallery_img = $product.find( '.p-nav .slick-slide[data-slick-index="0"] img' ), 891 $product_img_wrap = $product_gallery.find( '.woocommerce-product-gallery__image, .woocommerce-product-gallery__image--placeholder' ).eq( 0 ), 892 $product_img = $product_img_wrap.find( '.wp-post-image' ), 893 $product_link = $product_img_wrap.find( 'a' ).eq( 0 ); 894 if ($product.length < 1) return; 895 if ( variation && variation.image && variation.image.src && variation.image.src.length > 1 ) { 896 var exist = $product.find('.p-thumb .p-item img[data-large_image="'+variation.image.full_src+'"]'); 897 if (exist.length > 0) { 898 var index = exist.parents('.p-item').attr('data-slick-index'); 899 $( '.jas-carousel' ).slick( 'slickGoTo', index); 900 } else { 901 $product_img.wc_set_variation_attr( 'src', variation.image.src ); 902 $product_img.wc_set_variation_attr( 'height', variation.image.src_h ); 903 $product_img.wc_set_variation_attr( 'width', variation.image.src_w ); 904 $product_img.wc_set_variation_attr( 'srcset', variation.image.srcset ); 905 $product_img.wc_set_variation_attr( 'sizes', variation.image.sizes ); 906 $product_img.wc_set_variation_attr( 'title', variation.image.title ); 907 $product_img.wc_set_variation_attr( 'alt', variation.image.alt ); 908 $product_img.wc_set_variation_attr( 'data-src', variation.image.full_src ); 909 $product_img.wc_set_variation_attr( 'data-large_image', variation.image.full_src ); 910 $product_img.wc_set_variation_attr( 'data-large_image_width', variation.image.full_src_w ); 911 $product_img.wc_set_variation_attr( 'data-large_image_height', variation.image.full_src_h ); 912 $product_img_wrap.wc_set_variation_attr( 'data-thumb', variation.image.src ); 913 $gallery_img.wc_set_variation_attr( 'src', variation.image.thumb_src ); 914 $gallery_img.wc_set_variation_attr( 'srcset', variation.image.srcset ); 915 $product_link.wc_set_variation_attr( 'href', variation.image.full_src ); 916 } 917 } else { 918 $product_img.wc_reset_variation_attr( 'src' ); 919 $product_img.wc_reset_variation_attr( 'width' ); 920 $product_img.wc_reset_variation_attr( 'height' ); 921 $product_img.wc_reset_variation_attr( 'srcset' ); 922 $product_img.wc_reset_variation_attr( 'sizes' ); 923 $product_img.wc_reset_variation_attr( 'title' ); 924 $product_img.wc_reset_variation_attr( 'alt' ); 925 $product_img.wc_reset_variation_attr( 'data-src' ); 926 $product_img.wc_reset_variation_attr( 'data-large_image' ); 927 $product_img.wc_reset_variation_attr( 'data-large_image_width' ); 928 $product_img.wc_reset_variation_attr( 'data-large_image_height' ); 929 $product_img_wrap.wc_reset_variation_attr( 'data-thumb' ); 930 $gallery_img.wc_reset_variation_attr( 'src' ); 931 $gallery_img.wc_reset_variation_attr( 'srcset' ); 932 $product_link.wc_reset_variation_attr( 'href' ); 933 } 934 if ( JAS_Data_Js != undefined && JAS_Data_Js[ 'wc-single-zoom' ] && ! window._inQuickview ) { 935 window.setTimeout( function() { 936 $product_img_wrap.find('.zoomImg').remove(); 937 $product_img_wrap.zoom(); 938 }, 500); 939 } 940 window.setTimeout( function() { 941 $product_gallery.trigger( 'woocommerce_gallery_init_zoom' ); 942 $form.wc_maybe_trigger_slide_position_reset( variation ); 943 $( window ).trigger( 'resize' ); 944 }, 10 ); 945 }; 946 jQuery('.adsw-attribute-option .meta-item-img').on('click', function(){ 947 setTimeout(function(){ 948 jQuery('.jas-image-zoom .imgZoom').remove(); 949 jQuery('.jas-image-zoom').zoom(); 950 }, 100); 951 }); 952 } 953 954 // Init image zoom 955 var wcInitImageZoom = function() { 956 if ( $( '.jas-image-zoom' ).length > 0 && ! window._inQuickview && ! isMobile() ) { 957 958 var img = $( '.jas-image-zoom' ).each(function(index, el){ 959 if (!$(el).hasClass('zoomed')) { 960 $(el).zoom({ 961 touch: false 962 }); 963 $(el).addClass('zoomed'); 964 } 965 }); 966 } 967 } 968 969 // Add to cart popup 970 function wcPopupAddtocart() { 971 $( 'body' ).on( 'click', '.atc-popup .single_add_to_cart_button', function( e ) { 972 var _btn = $( this ), 973 _form = $( 'form.cart' ), 974 product_data = {}, 975 ajaxs = [], 976 ajaxCall = function(data, step) { // step: next call ajax 977 if (typeof step != 'undefined' ) { 978 var url = JASAjaxURL; 979 } else { 980 var url = JASAjaxURL+'?claucartf5=1'; 981 } 982 983 $.ajax({ 984 url: url, 985 type: 'POST', 986 data: { 987 action: 'jas_claue_popup_update_cart', 988 product_data: data 989 }, 990 beforeSend: function() { 991 _btn.append( '<i class="fa fa-spinner fa-pulse pa"></i>' ); 992 }, 993 success: function( response, status, jqXHR ) { 994 $( '.fa-spinner' ).remove(); 995 if (typeof step != 'undefined' ) { 996 var next = step + 1; 997 if (typeof ajaxs[next] != 'undefined') { 998 if (next == ajaxs.length - 1) { 999 ajaxCall(ajaxs[next]); 1000 } else { 1001 ajaxCall(ajaxs[next], next); 1002 } 1003 } 1004 } else { 1005 if ( typeof response == 'object' ) { 1006 $.magnificPopup.open({ 1007 items: { 1008 src: '<div class="product-quickview cart__popup pr">' + response.output + '</div>', 1009 type: 'inline' 1010 }, 1011 mainClass: 'mfp-fade', 1012 removalDelay: 800, 1013 }); 1014 } else { // error label 1015 $('body').append( response ); 1016 } 1017 1018 $( 'body' ).addClass( 'popup-opened' ); 1019 setTimeout( function() { 1020 $( '.mask-overlay' ).remove();
1021 $( 'body' ).removeClass( 'cart-opened' ); 1022 }, 1000) 1023 } 1024 } 1025 }); 1026 }; 1027 1028 if ( _btn.hasClass( 'disabled' ) || $( '.btn-atc' ).hasClass( 'no-ajax' ) ) return; 1029 1030 if ( _btn.parents( 'form' ).hasClass( 'variations_form' ) ) { 1031 var variation_id = parseInt( _form.find( '[name=variation_id]' ).val() ), 1032 product_id = parseInt( _form.find('[name=add-to-cart]' ).val() ), 1033 quantity = parseInt( _btn.next().attr( 'data-quantity' ) ); 1034 1035 1036 if ( variation_id ) { 1037 var attributes_select = _form.find( '.variations select' ), 1038 attributes = {}; 1039 1040 attributes_select.each( function() { 1041 attributes[ $( this ).data( 'attribute_name' ) ] = $( this ).val(); 1042 }); 1043 1044 attributes = JSON.stringify( attributes ); 1045 product_data['attributes'] = attributes; 1046 product_data['variation_id'] = variation_id; 1047 } 1048 1049 product_data['product_id'] = product_id; 1050 product_data['quantity'] = quantity || 1; 1051 1052 } else if (_btn.parents( 'form' ).hasClass( 'grouped_form' )) { 1053 var formGroupData = jQuery('.grouped_form').serializeArray(); 1054 jQuery.each(formGroupData, function(index, el){ 1055 if (el.name.indexOf('quantity[') == 0 && el.value > 0) { 1056 var pid = el.name.replace('quantity[', '').replace(']', ''), 1057 product_data = {}; 1058 product_data['product_id'] = pid; 1059 product_data['variation_id'] = 0; 1060 product_data['quantity'] = el.value || 1; 1061 product_data = JSON.stringify( product_data ); 1062 ajaxs.push(product_data); 1063 } 1064 }); 1065 if (ajaxs.length > 0) { 1066 if (ajaxs.length > 1) { 1067 ajaxCall(ajaxs[0], 0); 1068 } else { 1069 ajaxCall(ajaxs[0]); 1070 } 1071 } 1072 e.preventDefault(); 1073 return; 1074 } else { 1075 var product_id = _btn.data( 'product_id' ), 1076 quantity = _btn.attr( 'data-quantity' ), 1077 product_data = {}; 1078 1079 product_data['product_id'] = product_id; 1080 product_data['variation_id'] = 0; 1081 product_data['quantity'] = quantity || 1; 1082 } 1083 1084 product_data = JSON.stringify( product_data ); 1085 1086 ajaxCall(product_data); 1087 1088 e.preventDefault(); 1089 }); 1090 1091 $( 'body' ).on( 'click', '.modal_btn_add_to_cart', function( e ) { 1092 e.preventDefault(); 1093 1094 var _btn = $( this ); 1095 if ( _btn.hasClass( 'product_type_variable' ) ) { return; } 1096 1097 var product_id = _btn.data( 'product_id' ), quantity = 1, product_data = {}; 1098 1099 product_data['product_id'] = product_id; 1100 product_data['variation_id'] = 0; 1101 product_data['quantity'] = quantity; 1102 1103 product_data = JSON.stringify( product_data ); 1104 1105 $.ajax({ 1106 url: JASAjaxURL, 1107 type: 'POST', 1108 data: { 1109 action: 'jas_claue_popup_update_cart', 1110 product_data: product_data 1111 }, 1112 beforeSend: function() { 1113 $( '.cart__popup' ).addClass( 'loading' ); 1114 }, 1115 success: function( response, status, jqXHR ) { 1116 $( '.cart__popup' ).html( response.output ); 1117 $( '.cart__popup' ).removeClass( 'loading' ); 1118 } 1119 }); 1120 }) 1121 1122 function wcPopupUpdateAjax( cart_key, new_qty, undo_item ) { 1123 return $.ajax({ 1124 url: JASAjaxURL, 1125 type: 'POST', 1126 data: { 1127 action: 'jas_claue_popup_update_ajax', 1128 cart_key: cart_key, 1129 new_qty: new_qty, 1130 undo_item: undo_item || false 1131 } 1132 }); 1133 } 1134 function wcPopupUpdateCart( _this, new_qty ) { 1135 var _pwrap = _this.parents( '.cart__popup-item' ), 1136 _pdata = _pwrap.data( 'cart-item' ), 1137 _cartkey = _pdata.key, 1138 _pname = _pdata.pname, 1139 _qtyinput = _pwrap.find( '.cart__popup-qty--input' ); 1140 1141 $( '.cart__popup' ).addClass( 'loading' ); 1142 1143 wcPopupUpdateAjax( _cartkey, new_qty ).done( function( response, status, jqXHR ) { 1144 if ( jqXHR.getResponseHeader( 'content-type' ).indexOf( 'text/html' ) >= 0 ) { 1145 _qtyinput.val( focus_qty ); 1146 } else { 1147 _pwrap.find( '.cart__popup-total' ).html( response.ptotal ); 1148 $( '.cart__popup-stotal' ).html( response.cart_total ); 1149 1150 _qtyinput.val( new_qty ); 1151 } 1152 $( '.cart__popup' ).removeClass( 'loading' ); 1153 }); 1154 } 1155 1156 $( 'body' ).on( 'change','.cart__popup-qty--input', function( e ) { 1157 var _this = $( this ), 1158 new_qty = parseInt( _this.val( ) ), 1159 _step = parseInt( _this.attr( 'step' ) ), 1160 _min = parseInt( _this.attr( 'min' ) ), 1161 _max = parseInt( _this.attr( 'max' ) ), 1162 invalid = false;
1163 1164 if ( new_qty === 0 ) { 1165 _this.parents( '.cart__popup-item' ).find( '.cart__popup-remove' ).trigger( 'click' ); 1166 return; 1167 1168 } else if ( isNaN( new_qty ) || new_qty < 0 ) { 1169 invalid = true; 1170 1171 } else if ( new_qty > _max && _max > 0 ) { 1172 alert( 'Maximum product is: ' + _max ); 1173 invalid = true; 1174 1175 } else if ( new_qty < _min ) { 1176 invalid = true; 1177 1178 } else if ( ( new_qty % _step ) !== 0 ) { 1179 alert( 'Quantity can only be purchased in multiple of ' + _step ); 1180 invalid = true; 1181 1182 } else { 1183 wcPopupUpdateCart( _this, new_qty ); 1184 } 1185 1186 if ( invalid === true ) { 1187 _this.val( focus_qty ); 1188 } 1189 }); 1190 1191 $( 'body' ).on( 'click', '.cart__popup-qty' ,function() { 1192 var _this = $(this), 1193 _qty = _this.siblings( '.cart__popup-qty--input' ), 1194 _qtyinput = parseInt( _qty.val() ), 1195 _step = parseInt( _qty.attr( 'step' ) ), 1196 _min = parseInt( _qty.attr( 'min' ) ), 1197 _max = parseInt( _qty.attr( 'max' ) ); 1198 1199 _qty.trigger( 'focusin' ); 1200 1201 if ( _this.hasClass( 'cart__popup-qty--plus' ) ) { 1202 var _newqty = _qtyinput + _step; 1203 1204 if ( _newqty > _max && _max > 0 ) { 1205 alert( 'Maximum Quantity: ' + _max ); 1206 return; 1207 } 1208 } else if ( _this.hasClass( 'cart__popup-qty--minus' ) ) { 1209 var _newqty = _qtyinput - _step; 1210 if ( _newqty === 0 ) { 1211 _this.parents( '.cart__popup-item' ).find( '.cart__popup-remove' ).trigger( 'click' ); 1212 return; 1213 } else if ( _newqty < _min ) { 1214 return; 1215 } else if ( _qtyinput < 0 ) { 1216 alert( 'Invalid' ); 1217 return; 1218 } 1219 } 1220 wcPopupUpdateCart( _this, _newqty ); 1221 }) 1222 1223 // Remove item from the cart 1224 $( 'body' ).on( 'click', '.cart__popup-remove',function() { 1225 $( '.cart__popup' ).addClass( 'loading' ); 1226 1227 var _this = $( this ), 1228 _pwrap = _this.parents( '.cart__popup-item' ), 1229 _pdata = _pwrap.data( 'cart-item' ), 1230 _ckey = _pdata.key, 1231 new_qty = 0, 1232 _pname = _pdata.pname; 1233 1234 wcPopupUpdateAjax( _ckey, 0 ).done( function( response ) { 1235 _pwrap.after( '<div class="cart__popup-empty center-xs mt__15 mb__15">' + _pname + ' ' + JAS_Data_Js['popup_remove'] + ' <span class="cart__popup-undo fwb cb">' + JAS_Data_Js['popup_undo'] + '</span></div>' ) 1236 .hide() 1237 .attr( 'class', 'cart__popup-undo--active' ); 1238 1239 1240 $( '.cart__popup-stotal' ).html( response.cart_total ); 1241 $( '.cart__popup' ).removeClass( 'loading' ); 1242 }); 1243 }); 1244 1245 // Undo the product removed 1246 $( 'body' ).on( 'click', '.cart__popup-undo', function() { 1247 var _this = $( this ), 1248 _pwrap = _this.parents( '.cart__popup-empty' ), 1249 _pwraps = _pwrap.prev( '.cart__popup-undo--active' ); 1250 1251 if ( _pwraps.length === 0 ) { 1252 return; 1253 } 1254 $( '.cart__popup' ).addClass( 'loading' ); 1255 1256 var _data = _pwraps.data( 'cart-item' ), _cartkey = _data.key, _pid = _data._pid, qty = 10; 1257 1258 wcPopupUpdateAjax( _cartkey, qty, true ).done( function( response ) { 1259 _pwraps.attr( 'class','cart__popup-item flex middle-xs' ) 1260 .show() 1261 .find( '.cart__popup-quantity input' ).val( response.quantity ); 1262 1263 _pwrap.remove(); 1264 1265 $( '.cart__popup' ).removeClass( 'loading' ); 1266 $( '.cart__popup-stotal' ).html( response.cart_total ); 1267 }); 1268 }); 1269 1270 // Update cart number with custom add to cart and show mini cart with default add to cart 1271 $( document ).ajaxComplete( function( event, xhr, settings ) { 1272 if ( settings.url.indexOf( 'claucartf5' ) > 0 ) { 1273 refreshMiniCart( false ); 1274 } 1275 if ( settings.url.indexOf( 'jas-ajax' ) > 0 || settings.url.indexOf( 'add_to_cart' ) > 0 ) { // catch the default add to cart ajax 1276 $.magnificPopup.close(); 1277 if ( $( 'body').hasClass( 'jan-atc-behavior-popup' ) ) { // popup 1278 // Need call an ajax request to get custom cart content in popup. 1279 $.ajax({ 1280 url: JASAjaxURL, 1281 type: 'POST', 1282 data: { 1283 action: 'jas_claue_popup_content_ajax', 1284 }, 1285 success: function(response) { 1286 $.magnificPopup.open({ 1287 items: { 1288 src: '<div class="product-quickview cart__popup pr">' + response + '</div>', 1289 type: 'inline' 1290 }, 1291 mainClass: 'mfp-fade', 1292 removalDelay: 800 1293 }); 1294 } 1295 }); 1296 } else { // slide 1297 refreshMiniCart(true); 1298 } 1299 } 1300 }); 1301 } 1302 1303 /** 1304 * DOMready event. 1305 */ 1306 $( document ).ready( function() { 1307 initCarousel(); 1308 initMasonry(); 1309 initSearchForm(); 1310 initDropdownMenu(); 1311 initPushMenu(); 1312 initRTLMenu(); 1313 initQuickView(); 1314 initAddToCart(); 1315 initMiniCart(); 1316 initAjaxLoad(); 1317 initScrollReveal(); 1318 initCountdown(); 1319 initOpenswatch(); 1320 backToTop(); 1321 initMagnificPopup(); 1322 initSwitchCurrency(); 1323 initPreLoader(); 1324 wcInitPopupVideo(); 1325 wcLiveSearch(); 1326 wcInitSwitchLayout(); 1327 wcQuantityAdjust(); 1328 wcExtraContent(); 1329 wcInitSidebarFilter();
1330 wcTopSidebarMenu(); 1331 wcAccordion(); 1332 wcInitImageZoom(); 1333 wcStickyAddtocart(); 1334 wcPopupAddtocart(); 1335 initPrettyPhoto(); 1336 customThirdParties(); 1337 }); 1338 $( window ).load( function() { 1339 initStickyMenu(); 1340 wcStickySidebar(); 1341 }); 1342 1343})( 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.