1function fixFlexsliderHeight() { 2 // Fix the product slider on window resize 3 jQuery(".woocommerce-product-gallery").each(function () { 4 if (!jQuery(this).find(".flex-active-slide img").height()) return; 5 6 jQuery(this) 7 .find(".flex-viewport, .woocommerce-product-gallery__wrapper") 8 .css({ 9 height: jQuery(this).find(".flex-active-slide img").height(), 10 }); 11 }); 12} 13 14function toggleStickyHeader(toggle = false) { 15 var activeClass = "has-sticky"; 16 var currentlySticky = !!jQuery("header#header").hasClass(activeClass); 17 18 if (toggle && !currentlySticky) { 19 // Show sticky header 20 jQuery("header#header") 21 .addClass(activeClass) 22 .find(".header-wrapper") 23 .addClass("stuck"); 24 } else if (!toggle && currentlySticky) { 25 // Hide sticky header 26 jQuery("header#header") 27 .removeClass(activeClass) 28 .find(".header-wrapper") 29 .removeClass("stuck"); 30 } 31} 32 33jQuery(document).ready(function () { 34 // Show/hide ux-blocks on specific pages 35 jQuery("body.single .hide-ux-block").each(function () { 36 // Get class list from DOM element, not jQuery object 37 const classList = this.classList; 38 if (!classList) return; 39 40 Array.from(classList).forEach((className) => { 41 if (className.startsWith("show-on-")) { 42 const postId = className.replace("show-on-", ""); 43 44 // Check if we're on the specific post page 45 if (jQuery(`.postid-${postId}`).length > 0) { 46 // Show the corresponding ux-block 47 jQuery(`.hide-ux-block.${className}`).show(); 48 49 return; 50 } 51 } 52 }); 53 }); 54 55 if (jQuery(".product.product_tag-has-multiple-images .arrow-left").length) { 56 // Show arrows on product page if product has multiple images (by WP tag) 57 jQuery( 58 ".section-content .arrow-left, .section-content .arrow-right", 59 ).addClass("show"); 60 61 // Go to prev image 62 jQuery(".section-content .arrow-left").click(function () { 63 if (jQuery(".woocommerce-product-gallery--wcavi").length) { 64 jQuery(".woocommerce-product-gallery--wcavi").flexslider("prev"); 65 } else { 66 jQuery(".woocommerce-product-gallery").flexslider("prev"); 67 } 68 }); 69 // Go to next image 70 jQuery(".section-content .arrow-right").click(function () { 71 if (jQuery(".woocommerce-product-gallery--wcavi").length) { 72 jQuery(".woocommerce-product-gallery--wcavi").flexslider("next"); 73 } else { 74 jQuery(".woocommerce-product-gallery").flexslider("next"); 75 } 76 }); 77 } 78 79 // Style the Checkout button 80 jQuery(".wc-proceed-to-checkout .button").addClass("primary"); 81 82 // Change position of the next/prev buttons on Blog 83 jQuery("article.post .entry-content .gap-element") 84 .first() 85 .before(jQuery("article.post .navigation-post")); 86 87 jQuery(".arrow-right, .arrow-left").click(function () { 88 setTimeout(() => { 89 fixFlexsliderHeight(); 90 }, 1); 91 }); 92 93 // Remove the border radius for buttons on the Blog 94 jQuery( 95 "body.post-template-default.single .blog-wrapper .wp-block-button .wp-block-button__link", 96 ).addClass("no-border-radius"); 97 98 jQuery(window) 99 .resize(function () { 100 setTimeout(() => { 101 fixFlexsliderHeight(); 102 }, 1); 103 }) 104 .resize(); 105 106 // Cookie alert 107 var $cookieBar = jQuery("#sg_moove_gdpr_cookie_info_bar"); 108 if (localStorage.hidecookiebar) { 109 $cookieBar.remove(); 110 } else { 111 $cookieBar.show(); 112 } 113 jQuery("#sg_moove_gdpr_cookie_info_bar .mgbutton").click(function () { 114 localStorage.setItem("hidecookiebar", 1); 115 $cookieBar.remove(); 116 }); 117 118 jQuery("header#header") 119 .addClass("sticky-jump") 120 .removeClass("transparent") 121 .css("height", 75); 122 jQuery("#masthead").removeClass("hide-for-sticky"); 123 124 // Toggle Sticky header 125 jQuery(window).scroll(function () { 126 if (window.pageYOffset > 150) { 127 toggleStickyHeader(true); 128 } else { 129 toggleStickyHeader(false); 130 } 131 }); 132 133 // There's an issue with not loading the map on the contact page. This forces a reload of the map 134 if (jQuery("section .google-map").length) { 135 setTimeout(() => { 136 if (!jQuery("section .google-map .gm-style").length) { 137 // Call 'resize' when `.gm-style` does not exist when expected 138 window.dispatchEvent(new Event("resize")); 139 } 140 }, 100); 141 } 142});
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.