1(function ($) { 2 3 // Close Sidebar Woocommerce 4 $('.nv-sidebar-wrap aside .close svg').click(function(){ 5 $('html').attr('class', ''); 6 $('.nv-sidebar-wrap aside').removeClass('sidebar-open'); 7 }); 8 9 if ($(".wc-block-components-text-input").hasClass("has-error")) { 10 $( ".wc-block-components-totals-coupon__button" ).css("bottom", "33px !important"); 11 } 12 13 $(window).on('load', function() { 14 // Use setTimeout to delay the check and execution. 15 setTimeout(function() { 16 // Check if elements with classes `woocommerce-product-gallery__trigger` and `flex-viewport` exist 17 if ($('.single-product .woocommerce-product-gallery .woocommerce-product-gallery__trigger').length || $('.single-product .woocommerce-product-gallery .flex-viewport').length) { 18 // Select the element with class `woocommerce-product-gallery__trigger` 19 const triggerElement = $('.single-product .woocommerce-product-gallery .woocommerce-product-gallery__trigger'); 20 // Move the selected element to be a child of the element with class `flex-viewport` 21 $('.single-product .woocommerce-product-gallery .flex-viewport').append(triggerElement); 22 $('.single-product .woocommerce-product-gallery__image').append(triggerElement); 23 } 24 25 // Check if elements with classes `onsale` and `flex-viewport` exist 26 if ($('.single-product .onsale').length || $('.single-product .flex-viewport').length) { 27 // Select the element with class `onsale` 28 const triggerElement = $('.single-product .onsale'); 29 // Move the selected element to be a child of the element with class `flex-viewport` 30 $('.single-product .flex-viewport').append(triggerElement); 31 $('.single-product .woocommerce-product-gallery__image').append(triggerElement); 32 } 33 }, 200); 34 }); 35 36})(jQuery); 37 38(function ($) { 39 function addElementorButtonClass() { 40 $('.woocommerce .button').each(function() { 41 if (!$(this).hasClass('elementor-button')) { 42 $(this).addClass('elementor-button'); 43 } 44 }); 45 } 46 47 function observeDOMChanges() { 48 const targetNode = document.body; 49 const config = { childList: true, subtree: true }; 50 51 const callback = function(mutationsList) { 52 for (const mutation of mutationsList) { 53 if (mutation.type === 'childList') { 54 addElementorButtonClass(); 55 } 56 } 57 }; 58 59 const observer = new MutationObserver(callback); 60 observer.observe(targetNode, config); 61 } 62 63 function isElementorPreview() { 64 const urlParams = new URLSearchParams(window.location.search); 65 return urlParams.has('elementor-preview') || document.body.classList.contains('elementor-editor-active'); 66 } 67 68 $(document).ready(function() { 69 addElementorButtonClass(); 70 71 // if (isElementorPreview()) { 72 // console.log("Elementor Preview Detected"); 73 74 // document.body.classList.add('is-elementor-preview'); 75 // observeDOMChanges(); 76 77 // // apply color to button in live preview elementor 78 // function updateButtonColor() { 79 // let buttonColor = $('.elementor-button').css('background-color'); 80 81 // $('.button.add_to_cart_button').not('.solace-extra-add-to-cart .add_to_cart_button').css({ 82 // 'background-color': buttonColor, 83 // 'border-color': buttonColor 84 // }); 85 // } 86 87 // updateButtonColor(); 88 89 // setInterval(updateButtonColor, 1000); 90 // } 91 }); 92 93 94})(jQuery); 95 96 97
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.