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