1(function ($) { 2 "use strict"; 3 4 5 6 7 $(document).ready(function () { 8 if ($.fn.niceSelect) { 9 $('select').niceSelect(); 10 11 $('.product select, .woocommerce-account select').niceSelect('destroy') 12 } 13 14 if ($.fn.select2) { 15 16 $('.product select').select2(); 17 } 18 19 $(".menu-item-has-children > a").append('<span class="dropdownToggle"><i class="fas fa-angle-down"></i></span>'); 20 $('#wp-calendar td a').parent('td').addClass('has-calendar-link'); 21 22 $('.shadepro-header-area.sticky-header').wrap('<div class="sticky-wrapper"></div>'); 23 var headerHeight = $('.sticky-wrapper').height(), 24 stickyWrapper = $('.sticky-wrapper'); 25 stickyWrapper.css('height', headerHeight + "px") 26 window.onscroll = function () { 27 scrollFunction() 28 }; 29 30 function scrollFunction() { 31 32 if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) { 33 stickyWrapper.addClass("is-sticky"); 34 } else { 35 stickyWrapper.removeClass("is-sticky"); 36 } 37 if (document.body.scrollTop > 300 || document.documentElement.scrollTop > 300) { 38 $(".is-sticky .sticky-header").addClass("reveal-header"); 39 } else { 40 $(".is-sticky .sticky-header").removeClass("reveal-header"); 41 } 42 } 43 44 // comment load more button click event 45 $('.shadepro-comment-loadmore-btn').on('click', function () { 46 var button = $(this); 47 48 // decrease the current comment page value 49 shadepro_comment_loadmore.cpage--; 50 $.ajax({
51 url: shadepro_comment_loadmore.ajaxurl, // AJAX handler, declared before 52 data: { 53 'action': 'cloadmore', // wp_ajax_cloadmore 54 'post_id': shadepro_comment_loadmore.parent_post_id, // the current post 55 'cpage': shadepro_comment_loadmore.cpage, // current comment page 56 }, 57 type: 'POST', 58 beforeSend: function (xhr) { 59 button.text('Loading...'); // preloader here 60 }, 61 success: function (data) { 62 if (data) { 63 $('ol.comment-list').append(data); 64 button.text('More comments'); 65 // if the last page, remove the button 66 if (shadepro_comment_loadmore.cpage == 1) 67 button.remove(); 68 } else { 69 button.remove(); 70 } 71 } 72 }); 73 return false; 74 }); 75 76 }) 77 78 $(window).load(function () { 79 if ($.fn.masonry) { 80 $('.blog-content-row .posts-row').masonry({ 81 // options 82 itemSelector: '.posts-row>div', 83 84 }); 85 } 86 87 setTimeout(function () { 88 jQuery(".shadepro-preloader-wrap").fadeOut(500); 89 }, 500); 90 setTimeout(function () { 91 jQuery(".shadepro-preloader-wrap").remove(); 92 }, 2000); 93 94 navMenu(); 95 96 $(window).on('resize', function(){ 97 if ($(window).width() > 960) { 98 $(".main-navigation ul.navbar-nav li.menu-item-has-children>a").unbind('click'); 99 } 100 }) 101 102 103 if ($(window).width() > 960) { 104 $(".main-navigation ul.navbar-nav li.menu-item-has-children>a").unbind('click'); 105 } 106 107 108 }) 109 110 function shadeCartQtyBtn() { 111 $(".woocommerce .quantity").append('<span class="shade-qty-dec-btn shade-qty-counter">-</span><span class="shade-qty-inc-btn shade-qty-counter">+</span>'); 112 $(".woocommerce .quantity .shade-qty-counter").on("click", function () { 113 var $button = $(this); 114 var oldValue = $button.parent('.quantity').find("input").val(); 115 oldValue = oldValue ? oldValue : 0; 116 if ($button.hasClass("shade-qty-inc-btn")) { 117 var newVal = parseFloat(oldValue) + 1; 118 } else { 119 // Don't allow decrementing below zero 120 if (oldValue > 0) { 121 var newVal = parseFloat(oldValue) - 1; 122 } else { 123 newVal = 0; 124 } 125 } 126 $button.parent('.quantity').find("input").val(newVal); 127 $('.woocommerce div.quantity input.qty').change(); 128 }); 129 } 130 shadeCartQtyBtn(); 131 132 $(document).ajaxComplete(function (event, request, settings) { 133 if ($('.woocomerce-cart-form .quantity .shade-qty-counter')) { 134 $(".woocommerce .quantity .shade-qty-counter").remove(); 135 shadeCartQtyBtn(); 136 } 137 138 }); 139 140 function navMenu() { 141 142 // main menu toggleer icon (Mobile site only) 143 $('[data-toggle="navbarToggler"]').on("click", function (e) { 144 $('.navbar').toggleClass('active'); 145 $('.navbar-toggler-icon').toggleClass('active'); 146 $('body').toggleClass('offcanvas--open'); 147 e.stopPropagation(); 148 e.preventDefault(); 149 150 }); 151 $('.navbar-inner').on("click", function (e) { 152 e.stopPropagation(); 153 }); 154 155 // Remove class when click on body 156 $('body').on("click", function () { 157 $('.navbar').removeClass('active'); 158 $('.navbar-toggler-icon').removeClass('active'); 159 $('body').removeClass('offcanvas--open'); 160 }); 161 162 $('.main-navigation ul.navbar-nav li.menu-item-has-children>a').on("click", function (e) { 163 e.preventDefault(); 164 $(this).siblings('.sub-menu').toggle(); 165 $(this).parent('li').toggleClass('dropdown-active'); 166 }) 167 168 169 $(".shadepro-mega-menu> ul.sub-menu > li > a").unbind('click'); 170 171 172 } 173 174 175})(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.