1 2/** 3Custom Functions 4**/ 5 6function hide_notif_bar_on_scroll() { 7 if ( jQuery('body.has-mtsnb').length ) { 8 jQuery(window).scroll(function() { 9 var scrollTop = jQuery(window).scrollTop(); 10 var $notif_bar = jQuery(".mtsnb.mtsnb-fixed"); 11 12 if (scrollTop > 0) { 13 $notif_bar.removeClass('mtsnb-shown').addClass('mtsnb-hidden'); 14 jQuery('body.has-mtsnb').addClass('hidden-notif'); 15 } 16 }); 17 } 18} 19 20function masonry() { 21 if ( jQuery('.product-term__listing').length ) { 22 var $grid = jQuery('.grid-parent').masonry({ 23 columnWidth: '.grid-sizer', 24 itemSelector: '.grid-item', 25 percentPosition: true 26 }); 27 28 // layout Masonry after each image loads 29 $grid.imagesLoaded().progress( function() { 30 $grid.masonry('layout'); 31 jQuery('.term-grid .match-item').equalHeightGrid(4); 32 }); 33 34 var $grid2 = jQuery('.cat-grid').masonry({ 35 columnWidth: '.cat-grid .grid-sizer', 36 itemSelector: '.cat-item', 37 percentPosition: true 38 }); 39 40 // layout Masonry after each image loads 41 $grid2.imagesLoaded().progress( function() { 42 $grid2.masonry('layout'); 43 jQuery('.cat-grid .match-item a').responsiveEqualHeightGrid(); 44 }); 45 46 } 47} 48 49function product_gallery_slider() { 50 if ( jQuery('.single-product .yith_magnifier_gallery').length ) { 51 jQuery('.yith_magnifier_gallery').slick({ 52 slidesToShow: 3, 53 slidesToScroll: 1, 54 prevArrow:"<button type='button' class='slick-prev pull-left'><span aria-hidden='true' class='fas fa-chevron-left'></span></button>", 55 nextArrow:"<button type='button' class='slick-next pull-right'><i aria-hidden='true' class='fas fa-chevron-right'></i></button>" 56 }); 57 } 58} 59 60function wrap_woo_quantity() { 61 if ( jQuery('form.cart').length ) { 62 jQuery( ".elementor-widget-jet-single-add-to-cart .qtyplus_minus, .elementor-widget-jet-single-add-to-cart .quantity" ).wrapAll( "<div class='qty-inner-group' />"); 63 jQuery( ".elementor-widget-jet-single-add-to-cart .qty-label, .elementor-widget-jet-single-add-to-cart .qty-inner-group" ).wrapAll( "<div class='qty-group' />"); 64 65 jQuery('.variations select').select2({ 66 minimumResultsForSearch: Infinity 67 }); 68 } 69} 70 71function mtsnb_notif_bar() { 72 if ( jQuery('body.has-mtsnb').length ) { 73 jQuery('.mtsnb-hide').click(function() { 74 jQuery('body').toggleClass('hidden-notif'); 75 }); 76 } 77} 78 79function popular_searches_footer() { 80 if ( jQuery('.popular-search-btn').length ) { 81 jQuery('.popular-search-btn .elementor-icon-list-text').click(function() { 82 jQuery('#toggle-search').fadeToggle(); 83 }); 84 } 85} 86 87function afterpay_popup() { 88 if ( jQuery('.single-product #what-is-afterpay-trigger').length ) { 89 jQuery('#what-is-afterpay-trigger').fancybox(); 90 } 91} 92 93function woo_gallery_slider() { 94 if ( jQuery('.woo-product-gallery-slider .wpgs-nav').length ) { 95 jQuery('.woo-product-gallery-slider .wpgs-nav').slick({ 96 slidesToShow: 3, 97 slidesToScroll: 1, 98 asNavFor: '.wpgs-for', 99 focusOnSelect: true, 100 centerMode: true, 101 vertical: true, 102 verticalSwiping:true, 103 prevArrow: '<span class="slick-prev fas fa-arrow-up" aria-label="prev" style=""></span>', 104 nextArrow: '<span class="slick-next fas fa-arrow-down" aria-label="Next" style=""></span>', 105 responsive: [ 106 { 107 breakpoint: 1025, 108 settings: { 109 vertical: false, 110 verticalSwiping: false, 111 } 112 }, 113 { 114 breakpoint: 768, 115 settings: { 116 variableWidth: false, 117 vertical: false, 118 verticalSwiping: false, 119 slidesToShow: 3, 120 slidesToScroll: 1, 121 } 122 } 123 124 ], 125 }); 126 } 127} 128 129/** 130 * On Loads 131 */ 132jQuery(document).ready(function($) { 133 hide_notif_bar_on_scroll(); 134 masonry(); 135 wrap_woo_quantity(); 136 mtsnb_notif_bar(); 137 popular_searches_footer(); 138 afterpay_popup(); 139 woo_gallery_slider(); 140 141 // Get the menu instance 142 // Ultimately smartmenus is expecting a <ul> input, so you need to target the <ul> of the drop-down you're trying to affect. 143 var $menu = $('.elementor-nav-menu:first'); 144 145 // Get rid of the existing menu 146 $menu.smartmenus('destroy'); 147 148 // Re-instantiate the new menu, with no delay settings 149 $menu.smartmenus( { 150 subIndicatorsText: '', 151 subIndicatorsPos: 'append', 152 subMenusMaxWidth: '1000px', 153 hideDuration: 200, // the length of the fade-out animation 154 hideTimeout: 150, // timeout before hiding the sub menus 155 showTimeout: 0, // timeout before showing the sub menus 156 }); 157});
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.