Skip to content

Commit

Permalink
Move the line of adding the modal-active class
Browse files Browse the repository at this point in the history
  • Loading branch information
helenclx committed Oct 29, 2023
1 parent 7c0ccf1 commit 804a140
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Food-Recipe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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;
}

Expand Down

0 comments on commit 804a140

Please sign in to comment.