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