From 0f46fd8e25f236d6afadfa3aaf70f0e956dc7bfb Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Fri, 9 Aug 2024 00:46:13 +0200 Subject: [PATCH] Fix event add modal handler registration --- static/app.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/static/app.js b/static/app.js index 3a37b1d..c1b2fe3 100644 --- a/static/app.js +++ b/static/app.js @@ -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 + }) + } })()