From c04d82fd71b3067169cbdb0266285eb275ed3b19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4?= Date: Sat, 18 Jan 2025 02:46:42 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BD=D0=BE=2090?= =?UTF-8?q?%=20=D0=B4=D0=B7=2012?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/form.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/js/form.js b/js/form.js index de9eae6..03bd453 100644 --- a/js/form.js +++ b/js/form.js @@ -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(); } // Обработчик событий на кнопку отправить @@ -66,7 +59,7 @@ function setUserFormSubmit(evt) { sendData(new FormData(evt.target)) .then(() => { closeImgEdit(); - resetSettings(); + formElement.reset(); showSendSuccessAlert(); } )