From 472a2d05866f16d7b8047d4eef69611766c1d8dd Mon Sep 17 00:00:00 2001 From: PavelUd Date: Mon, 20 Nov 2023 19:38:52 +0500 Subject: [PATCH] fix 2 --- js/fullsize-images-render.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/fullsize-images-render.js b/js/fullsize-images-render.js index b1fe5f1..03b1205 100644 --- a/js/fullsize-images-render.js +++ b/js/fullsize-images-render.js @@ -3,7 +3,7 @@ const commentsCount = bigPicture.querySelector('.comments-count'); const likesCount = bigPicture.querySelector('.likes-count'); const bigImage = bigPicture.querySelector('.big-picture__img img'); const description = bigPicture.querySelector('.social__caption'); -const cancelButton = bigPicture.querySelector('.big-picture__cancel'); +const closeButton = bigPicture.querySelector('.big-picture__cancel'); const createComment = (avatar, name, text) => `
  • { commentsBlock.insertAdjacentHTML('afterbegin', comments.map((comment) => createComment(comment.avatar, comment.name, comment.message)).join('')); // Array(comments).map }; -const hideModal = () => { +function hideModal () { document.body.classList.remove('modal-open'); bigPicture.classList.add('hidden'); -}; +} document.onkeydown = (evt) => { if (evt.key === 'Escape') { @@ -32,7 +32,7 @@ document.onkeydown = (evt) => { } }; -cancelButton.onclick = hideModal; +closeButton.onclick = hideModal; const constructBigPicture = (picture, photos) =>{ const likes = picture.querySelector('.picture__likes');