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

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

Merged
merged 4 commits into from
Dec 5, 2024

Conversation

nkirkr
Copy link

@nkirkr nkirkr commented Dec 1, 2024

@keksobot keksobot changed the title module 8 task1 Открывается и закрывается Dec 1, 2024
@keksobot
Copy link
Contributor

keksobot commented Dec 1, 2024

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

keksobot pushed a commit that referenced this pull request Dec 1, 2024
js/post.js Outdated
const findPostContent = (evt, data) => {
const url = evt.target.closest('.picture').querySelector('img').src;
const photoId = Number(url.split('/').pop().split('.')[0]);
const res = data.find((photo) => photo.id === photoId);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Нужно дать более полноценное название для переменной

js/post.js Outdated
const url = evt.target.closest('.picture').querySelector('img').src;
const photoId = Number(url.split('/').pop().split('.')[0]);
const res = data.find((photo) => photo.id === photoId);
postModal.classList.remove('hidden');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Эту строчку уместнее использовать внутри openPostModal

js/post.js Outdated
document.body.classList.remove('modal-open');
};

document.addEventListener('keydown', (evt) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Обернуть код в функцию, для того чтобы удалить импорт модуля внутри main. Не забыть удалить обработчик после закрытия модального окна

@keksobot keksobot merged commit 85d0866 into htmlacademy-javascript:master Dec 5, 2024
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