This commit is contained in:
Aevann1 2022-02-03 11:43:00 +02:00
parent 2322f81f49
commit 481c2c78cb
3 changed files with 4 additions and 2 deletions

View file

@ -4,6 +4,8 @@ function collapse_comment(comment_id) {
const closed = element.classList.toggle("collapsed")
const top = element.getBoundingClientRect().y
document.querySelectorAll(`#${comment} .collapsed`).forEach(n => n.classList.remove('collapsed'))
if (closed && top < 0) {
element.scrollIntoView()
window.scrollBy(0, - 100)