1/** @format */ 2 3(function ($) { 4 'use strict'; 5 6 $(document).ready(function () { 7 // Add job apply form class 8 $('.page-job-apply .wpcf7-form').addClass('row'); 9 10 // Apply pull quote color 11 let pullquote_color = $('.wp-block-pullquote').attr('style'); 12 $('.wp-block-pullquote blockquote').attr('style', pullquote_color); 13 14 $('.tinv-wraper.tinv-wishlist a.tinvwl_add_to_wishlist_button').append( 15 '<i class="ti-heart"></i>' 16 ); 17 18 // Manage hash link prevent default 19 function hashLinkprevendDefault() { 20 let link = $('.menu li> a'); 21 22 link.on('click', function () { 23 let urlHash = $(this).attr('href').split('/'); 24 25 if (urlHash[urlHash.length - 1] === '#') { 26 return false; 27 } 28 }); 29 } 30 31 hashLinkprevendDefault(); 32 33 34 function mobileMenudropdown() { 35 36 let menuSelector = $('.menu li.submenu > a'); 37 let menuSelector2 = $('.menu li.submenu > a span'); 38 39 menuSelector.on('click', function (event) { 40 41 let urlHash = $(this).attr('href').split('/'); 42 if(urlHash[urlHash.length - 1] === '#') { 43 event.preventDefault(); 44 } 45 $(this).parent().find('ul').first().toggle(700); 46 $(this).parent().siblings().find('ul').hide(700); 47 }); 48 49 menuSelector2.on('click', function (event) { 50 event.preventDefault(); 51 $(this).parent().parent().find('ul').first().toggle(700); 52 $(this).parent().parent().siblings().find('ul').hide(700); 53 event.stopPropagation(); 54 }); 55 } 56 57 mobileMenudropdown(); 58 59 60 $('.navbar-nav .mega_menu>.dropdown-menu').wrap( 61 '<div class="mega_menu_inner"></div>' 62 ); 63 64 if ($('.comment_box .children').length > 0) { 65 $('.comment_box .children') 66 .addClass('list-unstyled reply_comment') 67 .removeClass('children'); 68 $('.reply_comment .post_comment').removeClass('post_comment'); 69 } 70 71 $('.widget_products').addClass('widget_product'); 72 $('.widget_top_rated_products').addClass('widget_product'); 73 $('.widget_recently_viewed_products').addClass('widget_product'); 74 $('.widget_products ul.product_list_widget').addClass('list-unstyled'); 75 $('.widget_product_search').addClass('search_widget_two'); 76 $('.widget_product_categories ').addClass('widget_category'); 77 78 $('.footer-widget:first-child .f_widget').removeClass('pl_70 '); 79 80 /*------------- preloader js --------------*/ 81 function loader() { 82 $(window).on('load', function () { 83 $('#ctn-preloader').addClass('loaded'); 84 // Una vez haya terminado el preloader aparezca el scroll 85 86 if ($('#ctn-preloader').hasClass('loaded')) { 87 // Es para que una vez que se haya ido el preloader se elimine toda la seccion preloader 88 $('#preloader') 89 .delay(900) 90 .queue(function () { 91 $(this).remove(); 92 }); 93 } 94 }); 95 } 96 97 loader(); 98 99 //* Navbar Fixed 100 function navbarFixed() { 101 if ($('.header_stick').length) { 102 $(window).scroll(function () { 103 var scroll = $(window).scrollTop(); 104 if (scroll) { 105 $('.header_stick').addClass('navbar_fixed'); 106 } else { 107 $('.header_stick').removeClass('navbar_fixed'); 108 } 109 }); 110 } 111 } 112 113 navbarFixed(); 114 115 if ($('.search-btn').length) { 116 $('.search-btn').on('click', function () { 117 $('body').addClass('open'); 118 setTimeout(function () { 119 $('.search-input').focus(); 120 }, 500); 121 return false; 122 }); 123 $('.close_icon').on('click', function () { 124 $('body').removeClass('open'); 125 return false; 126 }); 127 } 128 129 // hamburger_menu 130 function offcanvasActivator() { 131 if ($('.bar_menu').length) { 132 $('.bar_menu').on('click', function () { 133 $('#menu').toggleClass('show-menu'); 134 }); 135 $('.close_icon').on('click', function () { 136 $('#menu').removeClass('show-menu'); 137 }); 138 } 139 } 140 141 offcanvasActivator(); 142 $(window).on('load', function () { 143 if ($('.mega_menu_two .scroll').length) { 144 $('.mega_menu_two .scroll').mCustomScrollbar({ 145 mouseWheelPixels: 50, 146 scrollInertia: 0, 147 }); 148 } 149 }); 150 151 // Update cart button 152 $('.ar_top').on('click', function () { 153 var getID = $(this).next().attr('id'); 154 var result = document.getElementById(getID); 155 var qty = result.value; 156 $('.shopping_cart_area .cart_btn.cart_btn_two').removeAttr('disabled'); 157 if (!isNaN(qty)) { 158 result.value++; 159 $('.cart_btn.ajax_add_to_cart').attr('data-quantity', result.value); 160 } else { 161 return false; 162 } 163 }); 164 165 $('.ar_down').on('click', function () { 166 var getID = $(this).prev().attr('id'); 167 var result = document.getElementById(getID); 168 var qty = result.value; 169 $('.shopping_cart_area .cart_btn.cart_btn_two').removeAttr('disabled'); 170 if (!isNaN(qty) && qty > 0) { 171 result.value--; 172 $('.cart_btn.ajax_add_to_cart').attr('data-quantity', result.value); 173 } else { 174 return false; 175 } 176 }); 177 }); 178 179 var wincow_width = $(window).width(); 180 if (992 > wincow_width) { 181 $('.header_area').addClass('mobile_menu_enabled'); 182 } 183})(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.