HEX
Server: Apache
System: Linux ecngx285.inmotionhosting.com 4.18.0-553.79.1.lve.el8.x86_64 #1 SMP Wed Oct 15 17:59:35 UTC 2025 x86_64
User: zeusxp5 (3862)
PHP: 8.3.28
Disabled: NONE
Upload Files
File: /home/zeusxp5/tour.kamille.us/wp-content/themes/solace/js/scripts.js
(function ($) {

    // Close Sidebar Woocommerce
    $('.nv-sidebar-wrap aside .close svg').click(function(){
        $('html').attr('class', '');
        $('.nv-sidebar-wrap aside').removeClass('sidebar-open');
    });

    if ($(".wc-block-components-text-input").hasClass("has-error")) {
        $( ".wc-block-components-totals-coupon__button" ).css("bottom", "33px !important");
    }

    $(window).on('load', function() {
        // Use setTimeout to delay the check and execution.
        setTimeout(function() {
            // Check if elements with classes `woocommerce-product-gallery__trigger` and `flex-viewport` exist
            if ($('.single-product .woocommerce-product-gallery .woocommerce-product-gallery__trigger').length || $('.single-product .woocommerce-product-gallery .flex-viewport').length) {
                // Select the element with class `woocommerce-product-gallery__trigger`
                const triggerElement = $('.single-product .woocommerce-product-gallery .woocommerce-product-gallery__trigger');
                // Move the selected element to be a child of the element with class `flex-viewport`
                $('.single-product .woocommerce-product-gallery .flex-viewport').append(triggerElement);
                $('.single-product .woocommerce-product-gallery__image').append(triggerElement);
            }

            // Check if elements with classes `onsale` and `flex-viewport` exist
            if ($('.single-product .onsale').length || $('.single-product .flex-viewport').length) {
                // Select the element with class `onsale`
                const triggerElement = $('.single-product .onsale');
                // Move the selected element to be a child of the element with class `flex-viewport`
                $('.single-product .flex-viewport').append(triggerElement);
                $('.single-product .woocommerce-product-gallery__image').append(triggerElement);
            }
        }, 200);
    });

})(jQuery);

(function ($) {
    function addElementorButtonClass() {
        $('.woocommerce .button').each(function() {
            if (!$(this).hasClass('elementor-button')) {
                $(this).addClass('elementor-button');
            }
        });
    }

    function observeDOMChanges() {
        const targetNode = document.body; 
        const config = { childList: true, subtree: true };

        const callback = function(mutationsList) {
            for (const mutation of mutationsList) {
                if (mutation.type === 'childList') {
                    addElementorButtonClass(); 
                }
            }
        };

        const observer = new MutationObserver(callback);
        observer.observe(targetNode, config);
    }

    function isElementorPreview() {
        const urlParams = new URLSearchParams(window.location.search);
        return urlParams.has('elementor-preview') || document.body.classList.contains('elementor-editor-active');
    }

    $(document).ready(function() {
        addElementorButtonClass(); 

        // if (isElementorPreview()) {
        //     console.log("Elementor Preview Detected");

        //     document.body.classList.add('is-elementor-preview'); 
        //     observeDOMChanges();

        //     // apply color to button in live preview elementor
        //     function updateButtonColor() {
        //         let buttonColor = $('.elementor-button').css('background-color'); 
                
        //         $('.button.add_to_cart_button').not('.solace-extra-add-to-cart .add_to_cart_button').css({
        //             'background-color': buttonColor,
        //             'border-color': buttonColor
        //         });
        //     }
            
        //     updateButtonColor();
        
        //     setInterval(updateButtonColor, 1000);
        // }
    });
    

})(jQuery);