From 89cabeed6007a5eccae1bd66ffe8c62ddf6270a9 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Sat, 7 Feb 2026 10:18:25 +0100 Subject: [PATCH] added cancel selection option --- public/index.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index b72ad89..2e85aec 100644 --- a/public/index.html +++ b/public/index.html @@ -485,7 +485,7 @@ function dayClick(dk) { if (!isSelecting) { selectionStart = dk; isSelecting = true; - document.getElementById('sel-hint').textContent = '📍 Kattints a befejező dátumra'; + document.getElementById('sel-hint').textContent = '📍 Kattints a befejező dátumra (ESC = mégse)'; highlightSelection(dk, dk); } else { const start = selectionStart < dk ? selectionStart : dk; @@ -613,6 +613,16 @@ function escapeHtml(t) { return d.innerHTML; } +// Cancel selection with ESC +document.addEventListener('keydown', function(e) { + if (e.key === 'Escape' && isSelecting) { + isSelecting = false; + selectionStart = null; + document.getElementById('sel-hint').textContent = 'Kattints a kezdő dátumra a naptárban ↓'; + document.querySelectorAll('.cal-day').forEach(el => el.classList.remove('in-selection')); + } +}); + // Start checkAuth();