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