By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 toasts.js

View raw Download
text/plain • 472 B
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
}