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

Открывается и закрывается #7

Merged
merged 6 commits into from
Jan 20, 2025

Conversation

Amilotxak
Copy link

@Amilotxak Amilotxak commented Jan 17, 2025

@keksobot keksobot changed the title Открывается и закрывается Открывается и закрывается Jan 17, 2025
@keksobot
Copy link

♻️ Я собрал ваш пулреквест. Посмотреть можно здесь.

keksobot pushed a commit that referenced this pull request Jan 17, 2025
@keksobot
Copy link

♻️ Я собрал ваш пулреквест. Посмотреть можно здесь.

keksobot pushed a commit that referenced this pull request Jan 17, 2025
@keksobot
Copy link

♻️ Я собрал ваш пулреквест. Посмотреть можно здесь.

keksobot pushed a commit that referenced this pull request Jan 18, 2025
js/bigPosts.js Outdated
@@ -0,0 +1,62 @@
import { getPosts } from './data.js';

Copy link
Collaborator

Choose a reason for hiding this comment

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

js/bigPosts.js название файлов/папок - в kebab-case

js/bigPosts.js Outdated
const bigPicture = document.querySelector('.big-picture');
const commentsContainer = bigPicture.querySelector('.social__comments');
const closeBigPicture = bigPicture.querySelector('.big-picture__cancel');
const postsList = getPosts();
Copy link
Collaborator

Choose a reason for hiding this comment

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

мы НЕ получаем новый список, мы используем тот что уже получили в мейне

js/bigPosts.js Outdated
const closeBigPicture = bigPicture.querySelector('.big-picture__cancel');
const postsList = getPosts();

const openBigPicture = (pictureId) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

на этом этапе мы уже хотим знать тут какой элемент отрисоывать, а не его ид

};

const closeBigPictureOnEsc = (event) => {
if (event.key === 'Escape') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

в утилс функция на проверку ескейпа

js/main.js Outdated
render(postsList);

// Добавляю обработчик событий на контейнер с постами
const container = 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.

в мейне мы не вешаем слушатели, в мейне мы только получили данные и вызвали функции из модулей, которые уже навешали слушатели

@keksobot
Copy link

♻️ Я собрал ваш пулреквест. Посмотреть можно здесь.

keksobot pushed a commit that referenced this pull request Jan 20, 2025
const commentsContainer = bigPicture.querySelector('.social__comments');
const closeBigPicture = bigPicture.querySelector('.big-picture__cancel');
const container = 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.

название файла не забудь поменять на корректное и в kebab-case

const bigPictureHandler = (generatedPosts) => {
initBigPictureEvents();

container.addEventListener('click', (evt) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

выглядит так что это тоже входит в функцию initBigPictureEvents

@keksobot keksobot merged commit 74f1887 into htmlacademy-javascript:master Jan 20, 2025
1 check passed
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