1( function( $ ) { 2 class Pxl_Global_Handler extends elementorModules.frontend.handlers.Base { 3 onInit() { 4 var $element = this.$element, 5 element_settings = this.getElementSettings(), 6 animation_delay = parseFloat(element_settings.item_animation_delay * 1000) || 0.01, 7 custom_anm = element_settings.custom_anm || '', 8 item_animation = this.getCurrentDeviceSetting( 'item_animation' ); 9 if ( custom_anm != '' ) { 10 const observer = elementorModules.utils.Scroll.scrollObserver( { 11 callback: ( event ) => { 12 if ( event.isInViewport ) { 13 $element.addClass( 'pxl-animated' ); 14 observer.unobserve( this.$element[ 0 ] ); 15 } 16 }, 17 } ); 18 observer.observe( this.$element[ 0 ] ); 19 } 20 21 if ( item_animation ){ 22 if( $element.find('.pxl-animation').length > 0){ 23 $element.removeClass( item_animation ); 24 if ( this.current_animation ) { 25 $element.removeClass( this.current_animation ); 26 } 27 this.current_animation = item_animation; 28 29 const options = { 30 root: null, 31 threshold: 0, 32 rootMargin: '0px', 33 }; 34 const itemObserver = new IntersectionObserver( ( entries ) => { 35 entries.forEach( ( entry, index ) => { 36 var ani_delay = animation_delay * index; 37 38 if ( entry.isIntersecting ) { 39 setTimeout( () => { 40 $(entry.target).removeClass( 'pxl-invisible' ).addClass( 'pxl-animated ' + item_animation ); 41 }, ani_delay ); 42 itemObserver.unobserve( entry.target ); 43 } 44 }); 45 }, options ); 46 47 $element.find('.pxl-animation').each(function(index, el) { 48 49 itemObserver.observe( el ); 50 51 }); 52 53 } 54 55 } 56 } 57 } 58 59 60 $( window ).on( 'elementor/frontend/init', function() { 61 62 elementorFrontend.hooks.addAction('frontend/element_ready/widget', ($element) => { 63 elementorFrontend.elementsHandler.addHandler(Pxl_Global_Handler, { $element }); 64 }); 65 66 } ); 67 68 69} )( jQuery ); 70
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.