Heray-Was-Here
Server : Apache
System : Linux hybrid3195.ca.ns.planethoster.net 3.10.0-1160.119.1.el7.tuxcare.els19.x86_64 #1 SMP Mon Mar 31 17:29:00 UTC 2025 x86_64
User : alliancerealtynb ( 1004)
PHP Version : 7.4.33
Disable Function : noop
Directory :  /home/alliancerealtynb/dev.alliancerealty.nb.ca/wp-content/mu-plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/alliancerealtynb/dev.alliancerealty.nb.ca/wp-content/mu-plugins/alliance.js
(function() {
    var wrapper = document.querySelector('.sp-testimonial-free-wrapper');
    if (wrapper === null) return;

    var observer = new MutationObserver(function(mutations) {
        // Vérifier seulement si ce n'est pas la version mobile
        if (window.innerWidth < 480) return;

        mutations.forEach(function(mutationRecord) {
            if (!mutationRecord.oldValue.includes('transition')) {
                var height = 0;
                mutationRecord.target.querySelectorAll('.slick-slide[aria-hidden="false"]').forEach(function(slide) {
                    if (slide.offsetHeight > height) height = slide.offsetHeight;
                });

                if (height > 0) {
                    mutationRecord.target.parentElement.style.height = height + 'px';
                }
            }
        });    
    });

    var i = 0;
    var interval = setInterval(function() {
        var tracks = document.querySelectorAll('.sp-testimonial-free-wrapper .slick-list .slick-track');
        if (tracks.length > 0) {
            clearInterval(interval);

            tracks.forEach(function(track) {
                observer.observe(track, { attributes: true, attributeFilter: ['style'], attributeOldValue: true });

                if (window.innerWidth > 479) {
                    var height = 0;
                    track.querySelectorAll('.slick-slide[aria-hidden="false"]').forEach(function(slide) {
                        if (slide.offsetHeight > height) height = slide.offsetHeight;
                    });

                    if (height > 0) {
                        track.parentElement.style.height = height + 'px';
                    }
                }
            });
        } else {
            // On laisse tomber si ça fait 10 essais
            i++;
            if (i > 9) clearInterval(interval);
        }
    }, 1000);
}());

Hry