Skip to content

Commit

Permalink
fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelUd committed Nov 20, 2023
1 parent be54581 commit 472a2d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/fullsize-images-render.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => `<li class="social__comment">
<img
Expand All @@ -21,18 +21,18 @@ const createCommentsBlock = (comments) =>{
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') {
hideModal();
}
};

cancelButton.onclick = hideModal;
closeButton.onclick = hideModal;

const constructBigPicture = (picture, photos) =>{
const likes = picture.querySelector('.picture__likes');
Expand Down

0 comments on commit 472a2d0

Please sign in to comment.