1window.UAGBTestimonialCarousel = { 2 _setHeight( scope ) { 3 if ( scope.length > 0 ) { 4 const postWrapper = scope[ 0 ].querySelectorAll( '.slick-slide' ), 5 postActive = scope[ 0 ].querySelectorAll( '.slick-slide.slick-active' ); 6 let maxHeight = -1, 7 wrapperHeight = -1, 8 postActiveHeight = -1; 9 10 Object.keys( postActive ).forEach( ( key ) => { 11 const thisHeight = postActive[ key ].offsetHeight, 12 blogPost = postActive[ key ].querySelector( '.uagb-testimonial__wrap' ), 13 blogPostHeight = blogPost.offsetHeight; 14 15 if ( maxHeight < blogPostHeight ) { 16 maxHeight = blogPostHeight; 17 postActiveHeight = maxHeight + 15; 18 } 19 20 if ( wrapperHeight < thisHeight ) { 21 wrapperHeight = thisHeight; 22 } 23 } ); 24 25 Object.keys( postActive ).forEach( ( key ) => { 26 const selector = postActive[ key ].querySelector( '.uagb-testimonial__wrap' ); 27 selector.style.height = maxHeight + 'px'; 28 } ); 29 30 let selector = scope[ 0 ].querySelector( '.slick-list' ); 31 selector.style.height = postActiveHeight + 'px'; 32 maxHeight = -1; 33 wrapperHeight = -1; 34 Object.keys( postWrapper ).forEach( ( key ) => { 35 const $this = postWrapper[ key ]; 36 if ( $this.classList.contains( 'slick-active' ) ) { 37 return true; 38 } 39 40 selector = $this.querySelector( '.uagb-testimonial__wrap' ); 41 const blogPostHeight = selector.offsetHeight; 42 selector.style.height = blogPostHeight + 'px'; 43 } ); 44 } 45 }, 46 _unSetHeight( scope ) { 47 if ( scope.length > 0 ) { 48 const postWrapper = scope[ 0 ].querySelectorAll( '.slick-slide' ), 49 postActive = scope[ 0 ].querySelectorAll( '.slick-slide.slick-active' ); 50 51 Object.keys( postActive ).forEach( ( key ) => { 52 const selector = postActive[ key ].querySelector( '.uagb-tm__content' ); 53 selector.style.height = 'auto'; 54 } ); 55 56 Object.keys( postActive ).forEach( ( key ) => { 57 const $this = postWrapper[ key ]; 58 if ( $this.classList.contains( 'slick-active' ) ) { 59 return true; 60 } 61 const selector = $this.querySelector( '.uagb-tm__content' ); 62 selector.style.height = 'auto'; 63 } ); 64 } 65 }, 66}; 67 68// Set Carousel Height for Customiser. 69// eslint-disable-next-line no-unused-vars 70function uagb_carousel_height( id ) { 71 const wrap = document.querySelector( '#wpwrap .uagb-block-' + id + ' .is-carousel' ); 72 if ( wrap ) { 73 window.UAGBTestimonialCarousel._setHeight( wrap ); 74 } 75} 76 77// Unset Carousel Height for Customiser. 78// eslint-disable-next-line no-unused-vars 79function uagb_carousel_unset_height( id ) { 80 const wrap = document.querySelector( '#wpwrap .uagb-slick-carousel.uagb-block-' + id ); 81 if ( wrap ) { 82 window.UAGBTestimonialCarousel._unSetHeight( wrap ); 83 } 84}
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.