Fix event add modal handler registration

This commit is contained in:
Simon Bruder 2024-08-09 00:46:13 +02:00
parent 9207ff7ec8
commit 0f46fd8e25
Signed by: simon
GPG key ID: 347FF8699CDA0776

View file

@ -85,7 +85,10 @@
})
}
document.getElementById("add-event-modal").addEventListener("show.bs.modal", e => {
document.getElementById("event").value = e.relatedTarget.dataset.eventType
})
const addEventModal = document.getElementById("add-event-modal")
if (addEventModal !== null) {
addEventModal.addEventListener("show.bs.modal", e => {
document.getElementById("event").value = e.relatedTarget.dataset.eventType
})
}
})()