| Server IP : 193.146.211.90 / Your IP : 10.85.6.55 Web Server : Apache System : Linux wordpress-gti-69dcdb54f7-n4wdq 6.11.8-arch1-2 #1 SMP PREEMPT_DYNAMIC Fri, 15 Nov 2024 15:35:07 +0000 x86_64 User : 1001 ( 1001) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /bitnami/wordpress/wp-content/plugins/ultimate-addons-for-gutenberg/assets/js/ |
Upload File : |
window.UAGBTestimonialCarousel = {
_setHeight( scope ) {
if ( scope.length > 0 ) {
const postWrapper = scope[ 0 ].querySelectorAll( '.slick-slide' ),
postActive = scope[ 0 ].querySelectorAll( '.slick-slide.slick-active' );
let maxHeight = -1,
wrapperHeight = -1,
postActiveHeight = -1;
Object.keys( postActive ).forEach( ( key ) => {
const thisHeight = postActive[ key ].offsetHeight,
blogPost = postActive[ key ].querySelector( '.uagb-testimonial__wrap' ),
blogPostHeight = blogPost.offsetHeight;
if ( maxHeight < blogPostHeight ) {
maxHeight = blogPostHeight;
postActiveHeight = maxHeight + 15;
}
if ( wrapperHeight < thisHeight ) {
wrapperHeight = thisHeight;
}
} );
Object.keys( postActive ).forEach( ( key ) => {
const selector = postActive[ key ].querySelector( '.uagb-testimonial__wrap' );
selector.style.height = maxHeight + 'px';
} );
let selector = scope[ 0 ].querySelector( '.slick-list' );
selector.style.height = postActiveHeight + 'px';
maxHeight = -1;
wrapperHeight = -1;
Object.keys( postWrapper ).forEach( ( key ) => {
const $this = postWrapper[ key ];
if ( $this.classList.contains( 'slick-active' ) ) {
return true;
}
selector = $this.querySelector( '.uagb-testimonial__wrap' );
const blogPostHeight = selector.offsetHeight;
selector.style.height = blogPostHeight + 'px';
} );
}
},
_unSetHeight( scope ) {
if ( scope.length > 0 ) {
const postWrapper = scope[ 0 ].querySelectorAll( '.slick-slide' ),
postActive = scope[ 0 ].querySelectorAll( '.slick-slide.slick-active' );
Object.keys( postActive ).forEach( ( key ) => {
const selector = postActive[ key ].querySelector( '.uagb-tm__content' );
selector.style.height = 'auto';
} );
Object.keys( postActive ).forEach( ( key ) => {
const $this = postWrapper[ key ];
if ( $this.classList.contains( 'slick-active' ) ) {
return true;
}
const selector = $this.querySelector( '.uagb-tm__content' );
selector.style.height = 'auto';
} );
}
},
};
// Set Carousel Height for Customiser.
// eslint-disable-next-line no-unused-vars
function uagb_carousel_height( id ) {
const wrap = document.querySelector( '#wpwrap .uagb-block-' + id + ' .is-carousel' );
if ( wrap ) {
window.UAGBTestimonialCarousel._setHeight( wrap );
}
}
// Unset Carousel Height for Customiser.
// eslint-disable-next-line no-unused-vars
function uagb_carousel_unset_height( id ) {
const wrap = document.querySelector( '#wpwrap .uagb-slick-carousel.uagb-block-' + id );
if ( wrap ) {
window.UAGBTestimonialCarousel._unSetHeight( wrap );
}
}