From 0053dc39386a68ec7d7a0bd540878163bac20943 Mon Sep 17 00:00:00 2001 From: Michael Reber Date: Tue, 10 Feb 2026 22:38:01 +0100 Subject: [PATCH] Add close-cross on all toast-ban-event and unban events to quicker close them --- pkg/web/static/js/core.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pkg/web/static/js/core.js b/pkg/web/static/js/core.js index c18c13d..2a1c85b 100644 --- a/pkg/web/static/js/core.js +++ b/pkg/web/static/js/core.js @@ -75,9 +75,21 @@ function showBanEventToast(event) { + ' ' + escapeHtml(server) + ' • ' + escapeHtml(country) + ' ' + ' ' + + ' ' + ''; - - // Add click handler to scroll to ban events table + + // Close button handler + var closeBtn = toast.querySelector('button'); + closeBtn.addEventListener('click', function(e) { + e.stopPropagation(); + clearTimeout(autoRemoveTimer); + toast.classList.remove('show'); + setTimeout(function() { toast.remove(); }, 300); + }); + + // Click on toast body scrolls to ban events table toast.addEventListener('click', function() { var logSection = document.getElementById('logOverviewSection'); if (logSection) { @@ -92,7 +104,7 @@ function showBanEventToast(event) { toast.classList.add('show'); }); - setTimeout(function() { + var autoRemoveTimer = setTimeout(function() { toast.classList.remove('show'); setTimeout(function() { toast.remove();