From d4ef03b6f429f7a0fbf18520d88009dfb588dafb Mon Sep 17 00:00:00 2001 From: Gabriele Cimaschi Date: Mon, 14 Sep 2026 13:00:33 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20corretta=20intercettazione=20dello=20sho?= =?UTF-8?q?rtcut=20per=20l'invio=20delle=20email=20quando=20l'interfaccia?= =?UTF-8?q?=20=C3=A8=20aperta.=20fix:=20corretto=20shortcut=20per=20tornar?= =?UTF-8?q?e=20alla=20pagina=20ticket.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/app.js | 5 +++-- public/js/views/emailCompose.js | 17 ++++++++++++++++- public/js/views/shortcuts.js | 7 +++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/public/js/app.js b/public/js/app.js index ae65be6..240b650 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -64,6 +64,7 @@ const App = { create_ticket_open: { ctrl: true, alt: true, shift: false, key: 'n', enabled: true }, 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 }, + send_email_submit: { 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 }, ticket_list_open: { ctrl: true, alt: false, shift: true, key: 'Backspace', enabled: true }, @@ -278,7 +279,7 @@ const App = { toggleClearBtn(); } - // Global keyboard shortcuts (e.g. Crea Nuovo Ticket, Ricerca Spudorata) + // Global keyboard shortcuts (e.g. Crea Nuovo Ticket, Ricerca Spudorata, Torna a Elenco Ticket) document.addEventListener('keydown', (e) => { if (this.isShortcutTriggered(e, 'create_ticket_open')) { if (window.location.hash !== '#/tickets/new') { @@ -302,7 +303,7 @@ const App = { window.location.hash = '#/tickets'; } } - }); + }, true); // Check DB connection this.checkConnection(); diff --git a/public/js/views/emailCompose.js b/public/js/views/emailCompose.js index ec5e9ab..807b399 100644 --- a/public/js/views/emailCompose.js +++ b/public/js/views/emailCompose.js @@ -559,7 +559,22 @@ const EmailCompose = (() => { }); // Send - document.getElementById('ec-send').addEventListener('click', () => sendEmail(toTagsCtrl, ccTagsCtrl, bccTagsCtrl)); + const handleEmailSend = () => sendEmail(toTagsCtrl, ccTagsCtrl, bccTagsCtrl); + document.getElementById('ec-send').addEventListener('click', handleEmailSend); + + // Keyboard shortcut handler for email compose modal + const handleEmailKeydown = (e) => { + if (!document.getElementById('email-compose-overlay')) { + document.removeEventListener('keydown', handleEmailKeydown, true); + return; + } + if (App.isShortcutTriggered(e, 'send_email_submit')) { + e.preventDefault(); + e.stopPropagation(); + handleEmailSend(); + } + }; + document.addEventListener('keydown', handleEmailKeydown, true); } function processFiles(files) { diff --git a/public/js/views/shortcuts.js b/public/js/views/shortcuts.js index c5983b2..e19c8bb 100644 --- a/public/js/views/shortcuts.js +++ b/public/js/views/shortcuts.js @@ -93,6 +93,13 @@ const ShortcutsView = { context: 'Pagina Dettaglio Ticket', defaultCombo: { ctrl: true, alt: false, shift: false, key: 'Enter', enabled: true } }, + { + id: 'send_email_submit', + name: 'Invia Email', + description: 'Invia l\'email quando la finestra di composizione email รจ aperta', + context: 'Modal Composizione Email', + defaultCombo: { ctrl: true, alt: false, shift: false, key: 'Enter', enabled: true } + }, { id: 'pdf_save_edited', name: 'Salva Immagine / Allegato / PDF Modificato',