-
-
Notifications
You must be signed in to change notification settings - Fork 792
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added project-meetings-check.js file to evaluate the changes in new p…
…roject-meetings.js file
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { getEventData, insertEventSchedule } from "./utility/api-events.js"; | ||
/** | ||
* This type of function is called an IIFE function. The main function is the primarily controller that loads the recurring events on this page. | ||
* Refer: https://developer.mozilla.org/en-US/docs/Glossary/IIFE | ||
*/ | ||
(async function main() { | ||
const eventData = await getEventData(); | ||
|
||
// If the document is still loading, add an EventListener. There is no race conditiion because JavaScript has run-to-completion semantics | ||
if (document.readyState === "loading") { | ||
document.addEventListener( | ||
"DOMContentLoaded", | ||
function () { insertEventSchedule(eventData, "project-meetings") } | ||
); | ||
} | ||
|
||
// If the document is not in the loading state, the DOM content has loaded and the event schedule can be populated | ||
else { insertEventSchedule(eventData, "project-meetings") } | ||
|
||
//Displays/Inserts the user's time zone in the DOM | ||
document | ||
.querySelector("#userTimeZone") | ||
.insertAdjacentHTML("afterbegin", timeZoneText()); | ||
})(); |