-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
♻️ Я собрал ваш пулреквест. Посмотреть можно здесь. |
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); |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Обернуть код в функцию, для того чтобы удалить импорт модуля внутри main. Не забыть удалить обработчик после закрытия модального окна
🎓 Открывается и закрывается
💥 https://htmlacademy-javascript.github.io/2358369-kekstagram-2/9/