Skip to content

Commit

Permalink
Вносит правки в нейминг
Browse files Browse the repository at this point in the history
  • Loading branch information
harl-i committed Dec 19, 2024
1 parent f441375 commit 6d02f53
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions js/thumbnails.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ function showThumbnail(randomPhotoObjects) {
const fragment = document.createDocumentFragment();

randomPhotoObjects.forEach(({url, description, likes, comments }) => {
const newThumbnail = pictureTemplateElement.cloneNode(true);
const pictureElement = pictureTemplateElement.cloneNode(true);

newThumbnail.querySelector('img').src = url;
newThumbnail.querySelector('img').alt = description;
newThumbnail.querySelector('.picture__comments').textContent = comments.length;
newThumbnail.querySelector('.picture__likes').textContent = likes;
pictureElement.querySelector('img').src = url;
pictureElement.querySelector('img').alt = description;
pictureElement.querySelector('.picture__comments').textContent = comments.length;
pictureElement.querySelector('.picture__likes').textContent = likes;

fragment.appendChild(newThumbnail);
fragment.appendChild(pictureElement);
});

picturesContainer.appendChild(fragment);
Expand Down

0 comments on commit 6d02f53

Please sign in to comment.