Skip to content

Commit

Permalink
Update tutorial modal comments
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickaod committed May 20, 2024
1 parent 6047ea7 commit c16013b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,26 @@ const openButton = document.getElementById("btn");
const closeButton = document.querySelector("[data-close-modal]");
const modal = document.querySelector("[data-modal]");

/*
* Event listener for the open button of the modal.
* Opens the modal when the information button is clicked.
*/
openButton.addEventListener("click", () => {
modal.showModal();
});

/*
* Event listener for the close button of the modal.
* Closes the modal when the close button is clicked.
*/
closeButton.addEventListener("click", () => {
modal.close();
});

/*
* Event listener for the close cosition of the modal.
* Closes the modal when the user clicks off the area.
*/
modal.addEventListener("click", e => {
const dialogDimensions = modal.getBoundingClientRect();
if (
Expand Down

0 comments on commit c16013b

Please sign in to comment.