1( function( $ ) { 2 "use strict"; 3 4 $( window ).on( 'elementor/frontend/init', function() { 5 setTimeout(function(){ 6 $('.pxl-grid').each(function(index, element) { 7 var $grid_scope = $(this); 8 var $grid_masonry = $grid_scope.find('.pxl-grid-masonry'); 9 var isoOptions = { 10 itemSelector: '.pxl-grid-item', 11 layoutMode: 'masonry', 12 fitRows: { 13 gutter: 0 14 }, 15 percentPosition: true, 16 masonry: { 17 columnWidth: '.grid-sizer', 18 }, 19 containerStyle: null, 20 stagger: 30, 21 sortBy : 'name', 22 }; 23 var $grid_isotope = $grid_masonry.isotope(isoOptions); 24 25 26 $grid_scope.on('click', '.pxl-grid-filter .filter-item', function(e) { 27 28 var $this = $(this); 29 var term_slug = $this.attr('data-filter'); 30 31 $this.siblings('.filter-item.active').removeClass('active'); 32 $this.addClass('active'); 33 $grid_scope.find('.pxl-post--inner').removeClass('animated'); 34 35 if( $this.closest('.pxl-grid-filter').hasClass('ajax') ){ 36 var loadmore = $grid_scope.data('loadmore'); 37 loadmore.term_slug = term_slug; 38 aimo_grid_ajax_handler( $this, $grid_scope, $grid_isotope, 39 { action: 'aimo_load_more_post_grid', loadmore: loadmore, iso_options: isoOptions, handler_click: 'filter', scrolltop: 0 } 40 ); 41 }else{ 42 $grid_isotope.isotope({ filter: term_slug }); 43 44 if( $grid_scope.find('.pxl-grid-filter').hasClass('pxl-animate') ){ 45 var $animate_el = $grid_scope.find('.pxl-grid-filter'), 46 data = $animate_el.data('settings'); 47 if(typeof data != 'undefined' && typeof data['animation'] != 'undefined'){ 48 setTimeout(function () { 49 $animate_el.removeClass('pxl-invisible').addClass('animated ' + data['animation']); 50 }, data['animation_delay']); 51 }else{ 52 setTimeout(function () { 53 $animate_el.removeClass('pxl-invisible').addClass('animated fadeInUp'); 54 }, 300); 55 } 56 } 57 } 58 }); 59 60 $grid_scope.on('click', '.pxl-grid-pagination .ajax a.page-numbers', function(e) { 61 e.preventDefault(); 62 e.stopPropagation(); 63 var $this = $(this); 64 var loadmore = $grid_scope.data('loadmore'); 65 var paged = $this.attr('href'); 66 paged = paged.replace('#', ''); 67 loadmore.paged = parseInt(paged); 68 aimo_grid_ajax_handler( $this, $grid_scope, $grid_isotope, 69 { action: 'aimo_load_more_post_grid', loadmore: loadmore, iso_options: isoOptions, handler_click: 'pagination', scrolltop: 0, wpnonce: main_params.wpnonce } 70 ); 71 $('html,body').animate({scrollTop: $grid_scope.offset().top - 130}, 500); 72 }); 73 74 $grid_scope.on('click', '.btn-grid-loadmore', function(e) { 75 e.preventDefault(); 76 var $this = $(this); 77 var loadmore = $grid_scope.data('loadmore'); 78 loadmore.paged = parseInt($grid_scope.data('start-page')) + 1; 79 80 aimo_grid_ajax_handler( $this, $grid_scope, $grid_isotope, 81 { action: 'aimo_load_more_post_grid', loadmore: loadmore, iso_options: isoOptions, handler_click: 'loadmore', scrolltop: 0, wpnonce: main_params.wpnonce } 82 ); 83 }); 84 }); 85 }, 300); 86 87 function aimo_grid_ajax_handler($this, $grid_scope, $grid_isotope, args = {}){ 88 var settings = $.extend( true, {}, { 89 action: '', 90 loadmore: '', 91 iso_options: {}, 92 handler_click: '', 93 scrolltop: 0, 94 wpnonce: '' 95 }, args ); 96 97 var offset_top = $grid_scope.offset().top; 98 if( settings.handler_click == 'loadmore' ){ 99 var loadmore_text = $this.closest('.pxl-load-more').data('loadmore-text'); 100 var loading_text = $this.closest('.pxl-load-more').data('loading-text'); 101 } 102 103 $.ajax({ 104 url: main_params.ajax_url, 105 type: 'POST', 106 data: { 107 action: settings.action, 108 settings: settings.loadmore, 109 handler_click: settings.handler_click, 110 wpnonce: settings.wpnonce 111 }, 112 success: function( res ) { 113 114 if(res.status == true){ 115 116 if( settings.handler_click == 'loadmore' ){ 117 $grid_scope.find('.pxl-grid-inner').append(res.data.html) 118 }else{ 119 $grid_scope.find('.pxl-grid-inner .pxl-grid-item').remove(); 120 $grid_scope.find('.pxl-grid-inner').append(res.data.html); 121 } 122 123 124 if( settings.iso_options){ 125 $grid_isotope.isotope('destroy'); 126 $grid_isotope.isotope(settings.iso_options); 127 } 128 129 if( $grid_scope.find('.pxl-grid-filter').hasClass('pxl-animate') ){ 130 var $animate_el = $grid_scope.find('.pxl-grid-filter'), 131 data = $animate_el.data('settings'); 132 if(typeof data != 'undefined' && typeof data['animation'] != 'undefined'){ 133 setTimeout(function () { 134 $animate_el.removeClass('pxl-invisible').addClass('animated ' + data['animation']); 135 }, data['animation_delay']); 136 }else{ 137 setTimeout(function () { 138 $animate_el.removeClass('pxl-invisible').addClass('animated fadeInUp'); 139 }, 300); 140 } 141 } 142 143 $grid_scope.data('start-page', res.data.paged); 144 145 if( settings.loadmore['pagination_type'] == 'loadmore'){ 146 if(res.data.paged >= res.data.max){ 147 $grid_scope.find('.pxl-load-more').hide(); 148 }else{ 149 $grid_scope.find('.pxl-load-more').show(); 150 } 151 } 152 if( settings.loadmore['pagination_type'] == 'pagination'){ 153 $grid_scope.find(".pxl-grid-pagination").html(res.data.pagin_html); 154 } 155 156 } 157 158 }, 159 beforeSend: function() { 160 $grid_scope.find('.pxl-grid-overlay-loading').removeClass( 'loaded' ).addClass( 'loader' ); 161 if( settings.handler_click == 'loadmore' ){ 162 $this.find('.pxl-loadmore-text').text(loading_text); 163 $this.parent().addClass('loading'); 164 } 165 }, 166 complete: function() { 167 $grid_scope.find('.pxl-grid-overlay-loading').removeClass( 'loader' ).addClass( 'loaded' ); 168 if( settings.handler_click == 'loadmore' ){ 169 $this.find('.pxl-loadmore-text').text(loadmore_text); 170 $this.parent().removeClass('loading'); 171 } 172 if ( settings.scrolltop ) { 173 $( 'html, body' ).animate( { scrollTop: offset_top - 100 }, 0 ); 174 } 175 } 176 }); 177 } 178 }); 179 180} )( jQuery );
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.