diff --git a/files/assets/js/comments.js b/files/assets/js/comments.js
index 1bccb6174..2886d3b29 100644
--- a/files/assets/js/comments.js
+++ b/files/assets/js/comments.js
@@ -4,10 +4,9 @@ function timestamp(str, ti) {
};
function collapse_comment(comment_id) {
- const comment = "comment-" + comment_id
- const element = document.getElementById(comment)
- const closed = element.classList.toggle("collapsed")
- const top = element.getBoundingClientRect().y
+ const comment = `comment-${comment_id}`;
+ const closed = comment.classList.toggle("collapsed");
+ const top = comment.getBoundingClientRect().y;
const text = document.getElementById(`comment-text-${comment_id}`)
const actions = document.getElementById(`comment-${comment_id}-actions`)
@@ -16,10 +15,10 @@ function collapse_comment(comment_id) {
const arr = [text, actions, repliesOf];
arr.map(x => x.classList.toggle('hidden')); // hide comment elements
- comment.classList.toggle('items-center opacity-50') // apply flex alignment and opacity to comment parent wrapping div
+ comment.classList.toggle('items-center opacity-50'); // apply flex alignment and opacity to comment parent wrapping div
if (closed && top < 0) {
- element.scrollIntoView()
+ comment.scrollIntoView()
window.scrollBy(0, - 100)
}
};
\ No newline at end of file
diff --git a/files/templates/comments.html b/files/templates/comments.html
index f472a7d4c..c381615d8 100644
--- a/files/templates/comments.html
+++ b/files/templates/comments.html
@@ -37,7 +37,7 @@
{% endif %}
-
+
{% include "expanded_image_modal.html" %}