-
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
Надо подкачаться #11
Надо подкачаться #11
Conversation
js/photo-edit-modal.js
Outdated
const hashtagInputElement = formElement.querySelector('.text__hashtags'); | ||
const descriptionInputElement = formElement.querySelector('.text__description'); | ||
|
||
const clearForm = () => { |
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.
Вместо clearForm сбрасывай просто методом .reset() у формы
js/api.js
Outdated
import { cloneElement } from './utils.js'; | ||
|
||
const getData = () => { | ||
return fetch('https://31.javascript.htmlacademy.pro/kekstagram/data') |
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.
URL нужно вынести в константу
js/api.js
Outdated
cloneElement(errorTemplateElement); | ||
setTimeout(() => { | ||
document.querySelector('.data-error').classList.add('hidden'); | ||
}, 5000); |
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.
Таймаут нужно вынести в константу
import { closeModal, onEscapeDown } from './photo-edit-modal.js'; | ||
import { pristine } from './photo-edit-form-validation.js'; | ||
import { cloneElement } from './utils.js'; | ||
|
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.
Для getData и sendData нужно создать функцию с общей логикой
js/api.js
Outdated
submitButtonElement.disabled = true; | ||
|
||
fetch( | ||
'https://31.javascript.htmlacademy.pro/kekstagram', |
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.
'https://31.javascript.htmlacademy.pro/kekstagram' нужно вынести в константу
js/api.js
Outdated
|
||
if (pristine.validate()) { | ||
const formData = new FormData(evt.target); | ||
submitButtonElement.disabled = true; |
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.
submitButtonElement.disabled = true; -> submitButtonElement.setAttribute('disabled', 'true');
js/api.js
Outdated
fetch( | ||
'https://31.javascript.htmlacademy.pro/kekstagram', | ||
{ | ||
method: 'POST', |
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.
Для методов GET и POST нужно сделать перечисление
🎓 Надо подкачаться