The initialize method will be called by the DOMContentLoaded event automatically.

This commit is contained in:
Alex Tselegidis 2022-01-17 04:44:22 +01:00
parent 8438f647f0
commit 9467113ad9
3 changed files with 7 additions and 6 deletions

View File

@ -636,6 +636,8 @@ App.Components.AppointmentsModal = (function () {
addEventListeners();
}
document.addEventListener('DOMContentLoaded', initialize);
return {
resetModal,
initialize

View File

@ -107,12 +107,6 @@ App.Pages.Calendar = (function () {
* @param {String} view Optional (default), the calendar view to be loaded.
*/
function initialize(view) {
App.Utils.CalendarGoogleSync.initialize();
App.Components.AppointmentsModal.initialize();
App.Components.UnavailabilitiesModal.initialize();
// Load and initialize the calendar view.
if (view === 'table') {
App.Utils.CalendarTableView.initialize();

View File

@ -178,10 +178,15 @@ App.Utils.CalendarGoogleSync = (function () {
$.post(url, data);
}
/**
* Initialize the module.
*/
function initialize() {
bindEventHandlers();
}
document.addEventListener('DOMContentLoaded', initialize);
return {
initialize
};