1( function( $ ) { 2 3 $.sep_grid_refresh = function (){ 4 $('.ct-grid-masonry').each(function () { 5 var iso = new Isotope(this, { 6 itemSelector: '.grid-item', 7 percentPosition: true, 8 masonry: { 9 columnWidth: '.grid-sizer', 10 }, 11 containerStyle: null, 12 stagger: 30, 13 sortBy : 'name', 14 }); 15 16 var filtersElem = $(this).parent().find('.grid-filter-wrap'); 17 filtersElem.on('click', function (event) { 18 var filterValue = event.target.getAttribute('data-filter'); 19 iso.arrange({filter: filterValue}); 20 }); 21 22 var filterItem = $(this).parent().find('.filter-item'); 23 filterItem.on('click', function (e) { 24 filterItem.removeClass('active'); 25 $(this).addClass('active'); 26 }); 27 28 var filtersSelect = $(this).parent().find('.select-filter-wrap'); 29 filtersSelect.change(function() { 30 var filters = $(this).val(); 31 iso.arrange({filter: filters}); 32 }); 33 34 var orderSelect = $(this).parent().find('.select-order-wrap'); 35 orderSelect.change(function() { 36 var e_order = $(this).val(); 37 if(e_order == 'asc') { 38 iso.arrange({sortAscending: false}); 39 } 40 if(e_order == 'des') { 41 iso.arrange({sortAscending: true}); 42 } 43 }); 44 45 }); 46 } 47 48 /* Load More */ 49 $('.ct-grid').each(function () { 50 var _this_wrap = $(this); 51 var html_id = _this_wrap.attr('id'); 52 53 $(this).find('.ct-load-more').on('click', function (e) { 54 var loadmore = $(this).data('loadmore'); 55 var _this = $(this).parents(".ct-grid"); 56 var layout_type = _this.data('layout'); 57 loadmore.paged = parseInt(_this.data('start-page')) +1; 58 var _this_click = $(this); 59 _this_click.find('i').attr('class', 'fac fac-redo fa-spin'); 60 $.ajax({
61 url: main_data.ajax_url, 62 type: 'POST', 63 data: { 64 action: 'alico_load_more_post_grid', 65 settings: loadmore 66 } 67 }) 68 .done(function (res) { 69 if(res.status == true) { 70 var html = $("<div></div>").html(res.data.html); 71 html.find(".grid-item").addClass("ct-animated"); 72 html = html.html(); 73 _this.find('.ct-grid-inner').append(html); 74 _this.data('start-page', res.data.paged); 75 if(layout_type == 'masonry'){ 76 _this.imagesLoaded(function() { 77 $.sep_grid_refresh(); 78 $( ".ct-service-grid4 .ct-animated .grid-item-inner" ).hover( 79 function() { 80 $( this ).find('.item-readmore').slideToggle(300); 81 }, function() { 82 $( this ).find('.item-readmore').slideToggle(300); 83 } 84 ); 85 }); 86 } 87 if(res.data.paged >= res.data.max){ 88 _this_click.hide(); 89 } 90 } 91 }) 92 .fail(function (res) { 93 return false; 94 }) 95 .always(function () { 96 _this_click.find('i').attr('class', 'fac fac-redo'); 97 return false; 98 }); 99 }); 100 101 /* Pagination */ 102 $(document).on('click', '.ct-grid-pagination .ajax a.page-numbers', function() { 103 var _this = $(this).parents(".ct-grid"); 104 var loadmore = _this.find(".ct-grid-pagination").data('loadmore'); 105 var query_vars = _this.find(".ct-grid-pagination").data('query'); 106 var layout_type = _this.data('layout'); 107 var paged = $(this).attr('href'); 108 paged = paged.replace('#', ''); 109 loadmore.paged = parseInt(paged); 110 query_vars.paged = parseInt(paged); 111 // reload pagination 112 $.ajax({
113 url: main_data.ajax_url, 114 type: 'POST', 115 data: { 116 action: 'alico_get_pagination_html', 117 query_vars: query_vars 118 } 119 }).done(function (res) { 120 if(res.status == true){ 121 _this.find(".ct-grid-pagination").html(res.data.html); 122 } 123 }).fail(function (res) { 124 return false; 125 }).always(function () { 126 return false; 127 }); 128 // load post 129 $.ajax({ 130 url: main_data.ajax_url, 131 type: 'POST', 132 data: { 133 action: 'alico_load_more_post_grid', 134 settings: loadmore 135 } 136 }).done(function (res) { 137 if(res.status == true){ 138 _this.find('.ct-grid-inner .grid-item').remove(); 139 _this.find('.ct-grid-inner').append(res.data.html); 140 _this.data('start-page', res.data.paged); 141 if(layout_type == 'masonry'){ 142 _this.imagesLoaded(function() { 143 $.sep_grid_refresh(); 144 $('html, body').animate({scrollTop: _this.offset().top - 300}, 'slow'); 145 }); 146 } 147 } 148 }).fail(function (res) { 149 return false; 150 }).always(function () { 151 return false; 152 }); 153 return false; 154 }); 155 156 }); 157 158} )( 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.