feat: Add js to close notifications

This commit is contained in:
moanos [he/him] 2025-05-11 13:43:26 +02:00
parent 8bc9d12bfa
commit e11848ea72

View File

@ -19,3 +19,14 @@ document.addEventListener('DOMContentLoaded', () => {
});
});
// Looks for all notifications with a delete and allows closing them when pressing delete
document.addEventListener('DOMContentLoaded', () => {
(document.querySelectorAll('.notification .delete') || []).forEach(($delete) => {
const $notification = $delete.parentNode;
$delete.addEventListener('click', () => {
$notification.parentNode.removeChild($notification);
});
});
});