diff --git a/kursy/templates/calendar.html b/kursy/templates/calendar.html
index 75a8f6d..870bc22 100644
--- a/kursy/templates/calendar.html
+++ b/kursy/templates/calendar.html
@@ -89,6 +89,13 @@
});
}
+ // if ?modal=event_id is in the url, open the modal for that event
+ const urlParams = new URLSearchParams(window.location.search);
+ const modalEventId = urlParams.get('modal');
+ if (modalEventId) {
+ showModal(modalEventId);
+ }
+
document.addEventListener('DOMContentLoaded', function() {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
@@ -126,12 +133,6 @@
});
calendar.render();
- // if ?modal=event_id is in the url, open the modal for that event
- const urlParams = new URLSearchParams(window.location.search);
- const modalEventId = urlParams.get('modal');
- if (modalEventId) {
- showModal(modalEventId);
- }
});
{% endblock %}