Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Отрисуй меня полностью #6

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

furidasha
Copy link
Contributor

@furidasha furidasha commented Dec 21, 2024

@keksobot keksobot changed the title Добавляет генерацию миниатюр Отрисуй меня полностью Dec 23, 2024
photos.forEach((photo) => {
const photoElement = thumbnailsTemplate.cloneNode(true);

photoElement.querySelector('.picture__img').src = photo.url;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

photoElement.querySelector('.picture__img') дважды дублируется, по хорошему надо сохранить в переменную

@@ -0,0 +1,21 @@
const thumbnailsContainer = document.querySelector('.pictures');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Согласно критерию Д6 нужно переменным, хранящим DOM-элементы, добавлять единый суффикс node или element

У нас в файле и так все относится к thumbnails, потому можно оставить просто container
В итоге можно название переменной привести к такому виду
const thumbnailsContainer = document.querySelector('.pictures'); -> const containerElement = document.querySelector('.pictures');

@keksobot keksobot merged commit b2d40bd into htmlacademy-javascript:master Dec 24, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants