This commit is contained in:
kek7198 2021-12-09 16:09:39 -06:00
parent 2e33144e81
commit 9966f6d10a
2 changed files with 9 additions and 1 deletions

View file

@ -9,6 +9,14 @@ function collapse_comment(comment_id) {
const closed = element.classList.toggle("collapsed")
const top = element.getBoundingClientRect().y
const text = document.getElementById('comment-text-'+comment_id)
const actions = document.getElementById('comment-actions-'+comment_id)
const repliesOf = document.getElementById('replies-of-'+comment_id)
const arr = [text, actions, repliesOf];
arr.map(x => x.classList.toggle('hidden'));
if (closed && top < 0) {
element.scrollIntoView()
window.scrollBy(0, - 100)