1let inputRightLoteLastLote = $('.input_right_last'); 2let inputLeftLoteLastLote = $('.input_left_first'); 3let inputLeftLote = $('.input_left'); 4let inputRightLote = $('.input_right'); 5let num = 0; 6let bloqueiaPaginacao = false; 7 8function filtrosEstaoAtivos() { 9 const filtrosSalvos = sessionStorage.getItem('filtrosLotes'); 10 if (!filtrosSalvos) return false; 11 12 try { 13 const filtros = JSON.parse(filtrosSalvos); 14 return Object.values(filtros).some(v => v !== '' && v !== 0); 15 } catch (e) { 16 return false; 17 } 18} 19 20function paginacaoLotes(db_leiloes) { 21 let last_leiloes = parseInt(db_leiloes.currentPage); 22 23 // Remove links 24 inputRightLoteLastLote.removeAttr('href'); 25 inputRightLote.removeAttr('href'); 26 inputLeftLote.removeAttr('href'); 27 inputLeftLoteLastLote.removeAttr('href'); 28 29 // Limpa as listas 30 $('#leilao-lista').empty(); 31 $('#lotes-lista').empty(); 32 33 // Total de páginas 34 num = parseInt(db_leiloes.totalPages); 35 36 // Estado dos botões 37 if (last_leiloes === num) { 38 inputRightLoteLastLote.addClass('disabled-link'); 39 inputRightLote.addClass('disabled-link'); 40 } 41 42 if (last_leiloes > 1) { 43 inputLeftLote.removeClass('disabled-link'); 44 inputLeftLoteLastLote.removeClass('disabled-link'); 45 desabilitarDisplay.removeClass('desabilitar-display'); 46 } 47 48 if (last_leiloes === 1) { 49 inputLeftLote.addClass('disabled-link'); 50 inputLeftLoteLastLote.addClass('disabled-link'); 51 desabilitarDisplay.addClass('desabilitar-display'); 52 } 53 54 if (num !== last_leiloes) { 55 inputRightLoteLastLote.removeClass('disabled-link'); 56 desabilitarProximo.removeClass('desabilitar-proximo'); 57 inputRightLote.removeAttr('href'); 58 inputRightLote.removeClass('disabled-link'); 59 } 60 61 // Atualiza número da página 62 $('.number_pag').html(last_leiloes + ' de ' + num); 63 64 // Atualiza seletor de páginas 65 const sel = $('.number .sel'); 66 sel.empty(); 67 68 for (let i = 1; i <= num; i++) { 69 const $a = $('<a class="opt-list" style="display: flex;">').text(i); 70 $a.on('click', function (e) { 71 e.preventDefault(); 72 if (bloqueiaPaginacao || pageAtual === i) return; 73 74 bloqueiaPaginacao = true; 75 pageAtual = i; 76 77 if (filtrosEstaoAtivos()) { 78 getLotesFiltrados().finally(() => bloqueiaPaginacao = false); 79 } else { 80 getLeiloesGerais().finally(() => bloqueiaPaginacao = false); 81 } 82 }); 83 sel.append($a); 84 } 85} 86 87// Delegação do clique no seletor de páginas 88$(document).off('click', '.number').on('click', '.number', function () { 89 $(this).find('.sel').toggle().toggleClass('dropdown-active'); 90}); 91 92// Função auxiliar para chamada paginada com bloqueio 93function paginar(callback) { 94 if (bloqueiaPaginacao) return; 95 bloqueiaPaginacao = true; 96 97 callback().finally(() => { 98 bloqueiaPaginacao = false; 99 }); 100} 101 102// Controles de navegação 103inputLeftLote.click(function () { 104 if (pageAtual <= 1) return; 105 pageAtual--; 106 paginar(() => filtrosEstaoAtivos() ? getLotesFiltrados() : getLeiloesGerais()); 107}); 108 109inputLeftLoteLastLote.click(function () { 110 if (pageAtual === 1) return; 111 pageAtual = 1; 112 paginar(() => filtrosEstaoAtivos() ? getLotesFiltrados() : getLeiloesGerais()); 113}); 114 115inputRightLoteLastLote.click(function () { 116 if (pageAtual === num) return; 117 pageAtual = num; 118 paginar(() => filtrosEstaoAtivos() ? getLotesFiltrados() : getLeiloesGerais()); 119}); 120 121inputRightLote.click(function () { 122 if (pageAtual >= num) return; 123 pageAtual++; 124 paginar(() => filtrosEstaoAtivos() ? getLotesFiltrados() : getLeiloesGerais()); 125});
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.