Skip to content

Commit d5f9d79

Browse files
committed
fix: fixes spaces
1 parent 96e1aaa commit d5f9d79

2 files changed

Lines changed: 41 additions & 40 deletions

File tree

js/ui/big-picture/comments.js

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,67 +10,67 @@ let commentsShown = 0;
1010
let isLoaderInitialized = false;
1111

1212
const createComment = ({ avatar, name, message }) => {
13-
const li = document.createElement('li');
14-
li.className = 'social__comment';
13+
const li = document.createElement('li');
14+
li.className = 'social__comment';
1515

16-
const img = document.createElement('img');
17-
img.className = 'social__picture';
18-
img.src = avatar;
19-
img.alt = name;
20-
img.width = 35;
21-
img.height = 35;
16+
const img = document.createElement('img');
17+
img.className = 'social__picture';
18+
img.src = avatar;
19+
img.alt = name;
20+
img.width = 35;
21+
img.height = 35;
2222

23-
const text = document.createElement('p');
24-
text.className = 'social__text';
25-
text.textContent = message;
23+
const text = document.createElement('p');
24+
text.className = 'social__text';
25+
text.textContent = message;
2626

27-
li.append(img, text);
27+
li.append(img, text);
2828

29-
return li;
29+
return li;
3030
};
3131

3232
const renderComments = () => {
33-
const next = Math.min(commentsShown + COMMENTS_PER_PORTION, comments.length);
33+
const next = Math.min(commentsShown + COMMENTS_PER_PORTION, comments.length);
3434

35-
const fragment = document.createDocumentFragment();
35+
const fragment = document.createDocumentFragment();
3636

37-
for (let i = commentsShown; i < next; i++) {
38-
fragment.append(createComment(comments[i]));
39-
}
37+
for (let i = commentsShown; i < next; i++) {
38+
fragment.append(createComment(comments[i]));
39+
}
4040

41-
commentsList.append(fragment);
41+
commentsList.append(fragment);
4242

43-
commentsShown = next;
43+
commentsShown = next;
4444

45-
shownCount.textContent = String(commentsShown);
46-
totalCount.textContent = String(comments.length);
45+
shownCount.textContent = String(commentsShown);
46+
totalCount.textContent = String(comments.length);
4747

48-
if (commentsShown >= comments.length) {
49-
commentsLoader.classList.add('hidden');
50-
} else {
51-
commentsLoader.classList.remove('hidden');
52-
}
48+
if (commentsShown >= comments.length) {
49+
commentsLoader.classList.add('hidden');
50+
} else {
51+
commentsLoader.classList.remove('hidden');
52+
}
5353
};
5454

5555
const resetComments = (newComments = []) => {
56-
comments = newComments;
57-
commentsShown = 0;
56+
comments = newComments;
57+
commentsShown = 0;
5858

59-
commentsList.innerHTML = '';
60-
commentsLoader.classList.remove('hidden');
59+
commentsList.innerHTML = '';
60+
commentsLoader.classList.remove('hidden');
6161
};
6262

6363
const initCommentsLoader = () => {
64-
if (isLoaderInitialized) {
65-
return;
66-
}
67-
isLoaderInitialized = true;
64+
if (isLoaderInitialized) {
65+
return;
66+
}
67+
isLoaderInitialized = true;
6868

69-
commentsLoader.addEventListener('click', renderComments);
69+
commentsLoader.addEventListener('click', renderComments);
7070
};
7171

7272
export {
73-
renderComments,
74-
resetComments,
75-
initCommentsLoader,
73+
renderComments,
74+
resetComments,
75+
initCommentsLoader,
7676
};

js/ui/thumbnails.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ const renderThumbnails = (pictures, container, template) => {
2020
const fragment = document.createDocumentFragment();
2121

2222
pictures.forEach((picture) => {
23-
fragment.append(createThumbnail(picture, template));
23+
const thumbnail = createThumbnail(picture, template);
24+
fragment.append(thumbnail);
2425
});
2526

2627
container.append(fragment);

0 commit comments

Comments
 (0)