toasts.js
ASCII text
1function removeToast() { 2const button = event.target; 3el = button; 4 5// Check for the parent toast, remove it 6while (el && el.parentNode) { 7el = el.parentNode; 8 9if (el && el.parentNode.classList && el.parentNode.classList.contains("toast-container")) { 10el.classList.add("removing") 11el.addEventListener("animationend", () => { 12el.remove(); 13}); 14break; 15} 16} 17}