diff --git a/public/js/app.js b/public/js/app.js index ae75bdc..1ccbe09 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -65,6 +65,7 @@ const App = { create_ticket_submit: { ctrl: true, alt: false, shift: false, key: 'Enter', enabled: true }, quick_edit_save: { ctrl: true, alt: false, shift: false, key: 'Enter', enabled: true }, pdf_save_edited: { ctrl: true, alt: false, shift: false, key: 'Enter', enabled: true }, + ricerca_spudorata_open: { ctrl: true, alt: false, shift: true, key: 'f', enabled: true }, }; return defaults[id] || { ctrl: true, alt: false, shift: false, key: 'Enter', enabled: true }; }, @@ -261,13 +262,24 @@ const App = { toggleClearBtn(); } - // Global keyboard shortcuts (e.g. Crea Nuovo Ticket) + // Global keyboard shortcuts (e.g. Crea Nuovo Ticket, Ricerca Spudorata) document.addEventListener('keydown', (e) => { if (this.isShortcutTriggered(e, 'create_ticket_open')) { if (window.location.hash !== '#/tickets/new') { e.preventDefault(); window.location.hash = '#/tickets/new'; } + } else if (this.isShortcutTriggered(e, 'ricerca_spudorata_open')) { + e.preventDefault(); + if (!window.location.hash.startsWith('#/ricerca-spudorata')) { + window.location.hash = '#/ricerca-spudorata'; + } else { + const searchInput = document.getElementById('spudorata-search-input'); + if (searchInput) { + searchInput.focus(); + searchInput.select(); + } + } } }); diff --git a/public/js/views/ricercaSpudorata.js b/public/js/views/ricercaSpudorata.js index acc1617..0091a83 100644 --- a/public/js/views/ricercaSpudorata.js +++ b/public/js/views/ricercaSpudorata.js @@ -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 = ` +