From 804a1407c71dc5957365a97f0aab6addf8b7f3de Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Mon, 30 Oct 2023 00:41:29 +0800 Subject: [PATCH] Move the line of adding the modal-active class --- Food-Recipe/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Food-Recipe/index.js b/Food-Recipe/index.js index e8f0a42..5fd3920 100644 --- a/Food-Recipe/index.js +++ b/Food-Recipe/index.js @@ -218,7 +218,6 @@ function addDialog(name, url, video_url, description, countryTag, rating, cookTi const nutritionDetails = createNutritionDetails(nutrition); modal.append(close, mealName, mealImage, list, info, ingredientsText, instructionsText, linkContainer, nutritionDetails); document.querySelector('.results-section').appendChild(modal); - modal.classList.add('modal-active'); close.addEventListener('click', () => closeModal(modal)); document.body.addEventListener('keydown', (e) => handleKeyPress(e, modal)); @@ -229,6 +228,7 @@ function addDialog(name, url, video_url, description, countryTag, rating, cookTi function createModal() { const modal = document.createElement('div'); modal.classList.add('modal'); + modal.classList.add('modal-active'); return modal; }