1//console.log ("Load More News"); 2 3// VARIABLES 4 5(function($) { 6 7 var idexcluido = []; 8 9 //console.log ("Los ID excluidos son: "); 10 //console.log (idexcluido); 11 12 let currentPage = 1; 13 14 $('#load-more').on('click', function() { 15 16 //console.log ("CLICK"); 17 18 var valorData = $("li.Selected").data("filtro"); 19 20 //var valorData = ""; 21 //console.log ("El filtro activo antes de capturar de la url es: "); 22 //console.log (valorData); 23 24 if ((valorData == "") || (typeof valorData === 'undefined')){ 25 var urlParams = new URLSearchParams(window.location.search); 26 if (urlParams != ""){ 27 var valorData = urlParams.get('news'); 28 } 29 } 30 31 32 //console.log ("El filtro activo es: "); 33 //console.log (valorData); 34 35 $('#Grid_News .News_Card').each(function() { 36 37 if ($(this).data('id') !== "undefined"){ 38 39 idexcluido.push($(this).data('id')); 40 41 } 42 43 }); 44 45 //console.log (idexcluido); 46 47 currentPage++; // Do currentPage + 1, because we want to load the next page 48 49 //console.log ("La página siguiente es: "); 50 51 //console.log (currentPage); 52 53 $.ajax({ 54 type: 'POST', 55 url: '/wp-admin/admin-ajax.php', 56 dataType: 'json', // <-- Change dataType from 'html' to 'json' 57 data: { 58 action: 'news_load_more', 59 paged: currentPage, 60 idex: idexcluido, 61 news_filtro: valorData 62 }, 63 64 success: function (res) { 65 66 //console.log(res.html); 67 68 if(currentPage >= res.max) { 69 $('#load-more').hide(); 70 } 71 72 $('#Grid_News').append(res.html); 73 74 reordenaMasonry(); 75 //miFuncionDespuesDeAjax(); 76 //FuncionBolas(); 77 78 } 79 80 }); 81 82 //console.log (idexcluido); 83 84 }); 85 86})(jQuery); 87 88// REORDENA MASONRY 89 90function reordenaMasonry(){ 91 92 //console.log("Reordena Masonry"); 93 var grid = document.querySelector('.grid-container'); 94 var msnry = new Masonry(grid, { 95 itemSelector: '.News_Card', 96 columnWidth: '.News_Card', 97 percentPosition: true, 98 gutter: 40, 99 horizontalOrder: true 100 }); 101 102 imagesLoaded(grid).on('progress', function() { 103 // reorganiza Masonry cada vez que una imagen se carga 104 msnry.layout(); 105 }); 106 107}
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.