1jQuery(function ($) { 2 var bookmarks = JSON.parse(localStorage.getItem("bookmarks")) || []; 3 $(".add_to_wishlist").on('click',function(){ 4 const post_id = $(this).data('post_id'); 5 if (bookmarks.includes(post_id)) { 6 const index = bookmarks.indexOf(post_id); 7 if (index > -1) { // only splice array when item is found 8 bookmarks.splice(index, 1); // 2nd parameter means remove one item only 9 //set new bookmark data after removing bookmark 10 localStorage.setItem("bookmarks", JSON.stringify(bookmarks)); 11 $('.legend').text(bookmarks.length); 12 $(this)[0].children[0].src = ajax_params.directory_uri + '/assets/img/heart.svg'; 13 } 14 }else { 15 //set new bookmark data after adding bookmark 16 bookmarks.push(post_id); 17 localStorage.setItem("bookmarks", JSON.stringify(bookmarks)); 18 $('.legend').text(bookmarks.length); 19 $(this)[0].children[0].src = ajax_params.directory_uri + '/assets/img/heart_added.svg'; 20 } 21 }); 22 23 // Show count of wishlist blogs 24 const wishlist_count = JSON.parse(localStorage.getItem("bookmarks")) || []; 25 if(wishlist_count.length > 0){ 26 $('.legend').text(wishlist_count.length); 27 } 28 29 30 //Menu Hamburger icon 31 jQuery(".menu_toggle").click(function () { 32 jQuery(".main_mobile_menu").toggle(); 33 jQuery('body').addClass('full_screen_menu_active'); 34 }); 35 36 //Mobile Menu Close 37 jQuery('.mobile_close_button').click(function (){ 38 jQuery('.main_mobile_menu').toggle(); 39 jQuery('body').removeClass('full_screen_menu_active'); 40 }); 41 42 $('.main_mobile_menu .menu .menu-item-has-children > a').addClass('has-submenu'); 43 $('.main_mobile_menu .menu .menu-item-has-children > a').click(function(e){ 44 e.preventDefault(); 45 $(this).parent().find('ul').slideToggle('show_sub_menu'); 46 }); 47 48 $('.mobile_search_button').on('click',function (e){ 49 e.preventDefault(); 50 $('.full_screen_search').slideToggle(); 51 // $('#mobile-nav-offcanvas-layer').toggleClass('open'); 52 53 $('body').addClass('full_screen_menu_active'); 54 55 $('.mobile_menu').hide(); 56 57 }); 58 59 //Mobile Menu Close 60 $('.close_search_button').click(function (){ 61 $('.full_screen_search').slideToggle(); 62 $('#mobile-nav-offcanvas-layer').toggleClass('open'); 63 $('body').removeClass('full_screen_menu_active'); 64 $('#ajaxsearchprores10_1').hide(); 65 }); 66 67 68 //Mobile Menu Close 69 $('.close_newsletter, .open_newsletter_box').click(function (){ 70 $('.newsletter_box').slideToggle(); 71 }); 72 73 //Hide Menu when newlsetter box open 74 $('.main_mobile_menu .open_newsletter_box').click(function (){ 75 $('.main_mobile_menu').hide(); 76 $('body').removeClass('full_screen_menu_active'); 77 $('#ajaxsearchprores10_1').hide(); 78 }); 79 80
81 $('.close_woocommerce_alert_message').on('click',function () { 82 $(this).parent().parent().parent().html(''); 83 }) 84 85}); 86 87
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.