From 0b2cae5dd5348c1468f4b3ee3ee41e7ed6a3b948 Mon Sep 17 00:00:00 2001 From: brazilets Date: Thu, 4 Apr 2024 18:21:01 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=BD=D0=BE=D1=81=D0=B8=D1=82=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BF=D0=BE=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BC=D0=B5=D1=87=D0=B0=D0=BD=D0=B8=D1=8F=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/fullSize.js | 3 ++- js/uploadForm.js | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/fullSize.js b/js/fullSize.js index a5681ac..9655627 100644 --- a/js/fullSize.js +++ b/js/fullSize.js @@ -1,6 +1,7 @@ import { isEscapeKey, isEnterKey } from './util.js'; const COMMENTS_LOAD_STEP = 5; + const userBigPicture = document.querySelector('.big-picture'); const userBigPictureCancel = document.querySelector('.big-picture__cancel'); const likesCounter = userBigPicture.querySelector('.likes-count'); @@ -64,7 +65,7 @@ function openBigPicture(photo) { socialCommentCount.textContent = photo.comments.length < COMMENTS_LOAD_STEP ? photo.comments.length : COMMENTS_LOAD_STEP; setTimeout(() => { - if (photo.comments.length <= 5) { + if (photo.comments.length <= COMMENTS_LOAD_STEP) { commentsLoader.classList.add('hidden'); } else { commentsLoader.classList.remove('hidden'); diff --git a/js/uploadForm.js b/js/uploadForm.js index 458556a..e5272cd 100644 --- a/js/uploadForm.js +++ b/js/uploadForm.js @@ -49,10 +49,9 @@ function resetFormHandler() { document.body.classList.remove('modal-open'); document.addEventListener('keydown', onEscKeyDown); imgPreview.style.transform = 'scale(1)'; - imgPreview.style.filter = 'none'; + imgPreview.style.filter = ''; effect.classList.add('hidden'); scale.value = `${SCALE_MAX}%`; - imgPreview.style.transform = ''; effect.classList.add('hidden'); inputFile.value = ''; imgUploadForm.reset(); @@ -145,7 +144,7 @@ pristine.addValidator(commentInput, (value) => { } return value.length <= MAX_COMMENT_LENGTH; -}, 'Комментарий не может быть длиннее 140 символов.', 2); +}, 'Комментарий не может быть длиннее 140 символов.'); commentInput.addEventListener('keydown', (evt) => { if (evt.key === 'Escape') {