From bbca62fa8b7479d943943ae80c144b2eca3bf9b8 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 + }) + } })()