Skip to content

Commit

Permalink
исправляет замечания насчет названий
Browse files Browse the repository at this point in the history
  • Loading branch information
KateSolodchuk committed Dec 8, 2024
1 parent b5b673f commit a3d8bdb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion js/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import './util.js';
import {createPhotoList} from './data.js';
import {renderThumbnails, pictures} from './render-thumbnails.js';
import {renderThumbnails, picturesContainer} from './render-thumbnails.js';
import {initClickListener} from './open-full-picture.js';

const data = createPhotoList();
Expand Down
4 changes: 2 additions & 2 deletions js/open-full-picture.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {isEscapeKey} from './util.js';
import {pictures} from './render-thumbnails.js';
import {picturesContainer} from './render-thumbnails.js';
import {createComment} from './data.js';

const closeButton = document.querySelector('.big-picture__cancel');
Expand Down Expand Up @@ -41,7 +41,7 @@ function closeFullPicture() {
}

const initClickListener = (data) => {
pictures.addEventListener('click', (evt) => {
picturesContainer.addEventListener('click', (evt) => {
const currentPicture = evt.target.closest('.picture');

if (currentPicture) {
Expand Down
10 changes: 5 additions & 5 deletions js/render-thumbnails.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {createPhotoList} from './data.js';

const pictures = document.querySelector('.pictures');
const thumbnailsTemplate = document.querySelector('#picture')
const picturesContainer = document.querySelector('.pictures');
const thumbnailTemplate = document.querySelector('#picture')
.content
.querySelector('.picture');

Expand All @@ -11,7 +11,7 @@ const renderThumbnails = () => {
const usersThumbnailsFragment = document.createDocumentFragment();

usersThumbnails.forEach((photo) => {
const usersElement = thumbnailsTemplate.cloneNode(true);
const usersElement = thumbnailTemplate.cloneNode(true);
usersElement.dataset.pictureId = photo.id;
usersElement.querySelector('.picture__img').src = photo.url;
usersElement.querySelector('.picture__img').alt = photo.description;
Expand All @@ -20,8 +20,8 @@ const renderThumbnails = () => {
usersThumbnailsFragment.appendChild(usersElement);
});

pictures.appendChild(usersThumbnailsFragment);
picturesContainer.appendChild(usersThumbnailsFragment);

};

export {renderThumbnails, pictures};
export {renderThumbnails, picturesContainer};

0 comments on commit a3d8bdb

Please sign in to comment.