mypastebin/static/js/toast-handler.js
2025-05-29 22:40:58 +02:00

13 lines
470 B
JavaScript

function showToast(message, bgColor = 'bg-primary') {
const toastElement = document.getElementById('liveToast');
const toastBody = toastElement.querySelector('.toast-body');
toastBody.textContent = message;
toastElement.className = `toast align-items-center text-white ${bgColor} border-0`;
toastElement.style.display = 'block'; // Asegurar que sea visible antes de mostrar
const toast = new bootstrap.Toast(toastElement);
toast.show();
}