Skip to content

Commit

Permalink
Merge pull request #16 from brazilets/master
Browse files Browse the repository at this point in the history
  • Loading branch information
keksobot authored Apr 4, 2024
2 parents 3bb3768 + 0b2cae5 commit ca93f88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion js/fullSize.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down Expand Up @@ -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');
Expand Down
5 changes: 2 additions & 3 deletions js/uploadForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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') {
Expand Down

0 comments on commit ca93f88

Please sign in to comment.