1( function( $ ) { 2 setTimeout(function(){ 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 e.preventDefault(); 55 var loadmore = $(this).data('loadmore'); 56 var _this = $(this).parents(".ct-grid"); 57 var layout_type = _this.data('layout'); 58 loadmore.paged = parseInt(_this.data('start-page')) +1; 59 var _this_click = $(this); 60 _this_click.find('i').attr('class', 'fac fac-redo fa-spin'); 61 $.ajax({
62 url: main_data.ajax_url, 63 type: 'POST', 64 data: { 65 action: 'consultio_load_more_post_grid', 66 settings: loadmore 67 } 68 }) 69 .done(function (res) { 70 if(res.status == true) { 71 var html = $("<div></div>").html(res.data.html); 72 html.find(".grid-item").addClass("ct-animated"); 73 html = html.html(); 74 _this.find('.ct-grid-inner').append(html); 75 _this.data('start-page', res.data.paged); 76 if(layout_type == 'masonry'){ 77 _this.imagesLoaded(function() { 78 $.sep_grid_refresh(); 79 }); 80 } 81 if(res.data.paged >= res.data.max){ 82 _this_click.hide(); 83 } 84 } 85 }) 86 .fail(function (res) { 87 return false; 88 }) 89 .always(function () { 90 _this_click.find('i').attr('class', 'i-hidden'); 91 return false; 92 }); 93 }); 94 95 /* Pagination */ 96 $(document).on('click', '.ct-grid-pagination .ajax a.page-numbers', function() { 97 e.preventDefault(); 98 var _this = $(this).parents(".ct-grid"); 99 var loadmore = _this.find(".ct-grid-pagination").data('loadmore'); 100 var query_vars = _this.find(".ct-grid-pagination").data('query'); 101 var layout_type = _this.data('layout'); 102 var paged = $(this).attr('href'); 103 paged = paged.replace('#', ''); 104 loadmore.paged = parseInt(paged); 105 query_vars.paged = parseInt(paged); 106 // reload pagination 107 $.ajax({
108 url: main_data.ajax_url, 109 type: 'POST', 110 data: { 111 action: 'consultio_get_pagination_html', 112 query_vars: query_vars 113 } 114 }).done(function (res) { 115 if(res.status == true){ 116 _this.find(".ct-grid-pagination").html(res.data.html); 117 } 118 }).fail(function (res) { 119 return false; 120 }).always(function () { 121 return false; 122 }); 123 // load post 124 $.ajax({ 125 url: main_data.ajax_url, 126 type: 'POST', 127 data: { 128 action: 'consultio_load_more_post_grid', 129 settings: loadmore 130 } 131 }).done(function (res) { 132 if(res.status == true){ 133 _this.find('.ct-grid-inner .grid-item').remove(); 134 _this.find('.ct-grid-inner').append(res.data.html); 135 _this.data('start-page', res.data.paged); 136 if(layout_type == 'masonry'){ 137 _this.imagesLoaded(function() { 138 $.sep_grid_refresh(); 139 }); 140 } 141 } 142 }).fail(function (res) { 143 return false; 144 }).always(function () { 145 return false; 146 }); 147 return false; 148 }); 149 }); 150 }, 300); 151 152} )( 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.