This commit is contained in:
Markos Gogoulos
2026-02-20 12:36:50 +02:00
parent d28fc114f3
commit 58d336478c

View File

@@ -11,6 +11,27 @@
</div>
{% endfor %}
<script>
// This script is necessary because the React-based PageHeader component (which handles alert dismissal)
// is not mounted on all Django-rendered pages. This ensures the close button works globally.
document.addEventListener('DOMContentLoaded', function() {
var closeButtons = document.querySelectorAll('.alert .close');
closeButtons.forEach(function(btn) {
btn.addEventListener('click', function(e) {
var alert = this.closest('.alert');
if (alert) {
alert.classList.add('hiding');
setTimeout(function() {
if (alert.parentNode) {
alert.parentNode.removeChild(alert);
}
}, 400);
}
});
});
});
</script>
{% endif %}
{% endblock %}