From 6d02f53a37df601db803bef26083599452476a27 Mon Sep 17 00:00:00 2001 From: Ilya Kharlamov Date: Thu, 19 Dec 2024 14:58:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=BD=D0=BE=D1=81=D0=B8=D1=82=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=B2=20=D0=BD=D0=B5=D0=B9?= =?UTF-8?q?=D0=BC=D0=B8=D0=BD=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/thumbnails.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/thumbnails.js b/js/thumbnails.js index 2c73c0e..a9b9d85 100644 --- a/js/thumbnails.js +++ b/js/thumbnails.js @@ -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);