fix: ora è possibile variare la quantità di risultati dalla pagina ricerca spudorata. feat: aggiunto shortcut ctrl+shift+f per raggiungere la pagina ricerca spudorata.
This commit is contained in:
1 parent
6944b02263
commit
a15ab7e89d
3 files changed
+61
-6
No files matched your search
@@ -49,6 +49,14 @@ const RicercaSpudorataView = {
|
||||
|
||||
this.renderContainer(container);
|
||||
this.bindEvents();
|
||||
|
||||
setTimeout(() => {
|
||||
const input = document.getElementById('spudorata-search-input');
|
||||
if (input) {
|
||||
input.focus();
|
||||
input.select();
|
||||
}
|
||||
}, 50);
|
||||
},
|
||||
|
||||
renderContainer(container) {
|
||||
@@ -420,15 +428,32 @@ const RicercaSpudorataView = {
|
||||
},
|
||||
|
||||
renderPagination(current, perPage, total, totalPages, isTop = false) {
|
||||
const limitSelectHtml = `
|
||||
<div style="display:inline-flex; align-items:center; gap:var(--space-xs); font-size:0.8rem; color:var(--text-secondary);">
|
||||
<span>Righe:</span>
|
||||
<select class="form-select spudorata-per-page-select" style="padding: 2px 24px 2px 6px; font-size: 0.75rem; height: 26px; min-width: 65px; margin: 0; background-position: right 6px center; border-color: var(--border-light);">
|
||||
<option value="10" ${perPage === 10 ? 'selected' : ''}>10</option>
|
||||
<option value="20" ${perPage === 20 ? 'selected' : ''}>20</option>
|
||||
<option value="50" ${perPage === 50 ? 'selected' : ''}>50</option>
|
||||
<option value="100" ${perPage === 100 ? 'selected' : ''}>100</option>
|
||||
<option value="200" ${perPage === 200 ? 'selected' : ''}>200</option>
|
||||
<option value="500" ${perPage === 500 ? 'selected' : ''}>500</option>
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
|
||||
return `
|
||||
<div class="pagination" style="${isTop ? 'margin-bottom:var(--space-md);' : 'margin-top:var(--space-md);'} align-items:center; justify-content:space-between; display:flex;">
|
||||
<div class="pagination-info" style="font-size:0.82rem; color:var(--text-tertiary);">
|
||||
Mostrati ${Math.min(total, (current - 1) * perPage + 1)}-${Math.min(total, current * perPage)} di ${total} ticket
|
||||
Mostrati ${total > 0 ? Math.min(total, (current - 1) * perPage + 1) : 0}-${Math.min(total, current * perPage)} di ${total} ticket
|
||||
</div>
|
||||
<div class="pagination-buttons" style="display:flex; gap:4px;">
|
||||
<button class="pagination-btn spudorata-page-btn" data-page="${Math.max(1, current - 1)}" ${current === 1 ? 'disabled' : ''}>«</button>
|
||||
${this.renderPageNumbers(current, totalPages)}
|
||||
<button class="pagination-btn spudorata-page-btn" data-page="${Math.min(totalPages, current + 1)}" ${current === totalPages ? 'disabled' : ''}>»</button>
|
||||
<div class="pagination-controls" style="display:flex; align-items:center; gap:var(--space-sm);">
|
||||
${limitSelectHtml}
|
||||
<div class="pagination-buttons" style="display:flex; gap:4px;">
|
||||
<button class="pagination-btn spudorata-page-btn" data-page="${Math.max(1, current - 1)}" ${current === 1 ? 'disabled' : ''}>«</button>
|
||||
${this.renderPageNumbers(current, totalPages)}
|
||||
<button class="pagination-btn spudorata-page-btn" data-page="${Math.min(totalPages, current + 1)}" ${current === totalPages ? 'disabled' : ''}>»</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
@@ -575,6 +600,17 @@ const RicercaSpudorataView = {
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelectorAll('.spudorata-per-page-select').forEach(sel => {
|
||||
sel.addEventListener('change', (e) => {
|
||||
const val = parseInt(e.target.value, 10);
|
||||
if (!isNaN(val) && val > 0) {
|
||||
this.perPage = val;
|
||||
this.currentPage = 1;
|
||||
this.renderLocalResults();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelectorAll('.spudorata-page-btn').forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
const page = parseInt(btn.dataset.page, 10);
|
||||
|
||||
@@ -65,6 +65,13 @@ const ShortcutsView = {
|
||||
context: 'Globale',
|
||||
defaultCombo: { ctrl: true, alt: true, shift: false, key: 'n', enabled: true }
|
||||
},
|
||||
{
|
||||
id: 'ricerca_spudorata_open',
|
||||
name: 'Apri Ricerca Spudorata',
|
||||
description: 'Naviga direttamente alla pagina di Ricerca Spudorata o mette a fuoco il campo di ricerca',
|
||||
context: 'Globale',
|
||||
defaultCombo: { ctrl: true, alt: false, shift: true, key: 'f', enabled: true }
|
||||
},
|
||||
{
|
||||
id: 'create_ticket_submit',
|
||||
name: 'Invia Nuovo Ticket',
|
||||
|
||||
Reference in new issue
Block a user