From 377e8f6776dc7e2bfd32fd804eaf0d35ff137094 Mon Sep 17 00:00:00 2001 From: LD-Reborn Date: Sun, 23 Nov 2025 15:35:23 +0100 Subject: [PATCH] Fixed toast warning type not accessible --- src/wwwroot/js/site.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wwwroot/js/site.js b/src/wwwroot/js/site.js index c1bd0c8..a30dea4 100644 --- a/src/wwwroot/js/site.js +++ b/src/wwwroot/js/site.js @@ -12,14 +12,19 @@ function showToast(message, type) { const toast = document.createElement('div'); toast.className = `toast align-items-center text-white bg-${type} border-0`; toast.role = 'alert'; + var useDarkElements = type === "warning" toast.innerHTML = `
${message}
- +
`; + if (useDarkElements) { + toast.classList.remove("text-white"); + toast.classList.add("text-dark"); + } toastContainer.appendChild(toast); - const bsToast = new bootstrap.Toast(toast, { delay: 3000 }); + const bsToast = new bootstrap.Toast(toast, { delay: 5000 }); bsToast.show(); toast.addEventListener('hidden.bs.toast', () => toast.remove()); }