diff --git a/src/fellchensammlung/static/fellchensammlung/js/toggles.js b/src/fellchensammlung/static/fellchensammlung/js/toggles.js index 3e34d9c..ac0c05b 100644 --- a/src/fellchensammlung/static/fellchensammlung/js/toggles.js +++ b/src/fellchensammlung/static/fellchensammlung/js/toggles.js @@ -18,4 +18,15 @@ 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); + }); + }); }); \ No newline at end of file