Skip to content

Commit

Permalink
Сделано 90% дз 12
Browse files Browse the repository at this point in the history
  • Loading branch information
generalofgotei committed Jan 17, 2025
1 parent d648072 commit c04d82f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions js/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,8 @@ function onKeydownDocument(evt) {
function closeImgEdit() {
imgEditElement.classList.add('hidden');
document.body.classList.remove('modal-open');
imgUploadElement.value = '';
stopValidator();
resetSettings();
}

function resetSettings() {
imgUploadElement.value = '';
newCommentElement.value = '';
newHashTagsElement.value = '';
formElement.reset();
}

// Обработчик событий на кнопку отправить
Expand All @@ -66,7 +59,7 @@ function setUserFormSubmit(evt) {
sendData(new FormData(evt.target))
.then(() => {
closeImgEdit();
resetSettings();
formElement.reset();
showSendSuccessAlert();
}
)
Expand Down

0 comments on commit c04d82f

Please sign in to comment.