perf(calendar.html): load modal faster
This commit is contained in:
@@ -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() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
var calendarEl = document.getElementById('calendar');
|
var calendarEl = document.getElementById('calendar');
|
||||||
var calendar = new FullCalendar.Calendar(calendarEl, {
|
var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||||
@@ -126,12 +133,6 @@
|
|||||||
});
|
});
|
||||||
calendar.render();
|
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);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user