This commit is contained in:
kek7198 2021-12-09 19:28:38 -06:00
parent fbdb0319c9
commit f492012494
2 changed files with 3 additions and 2 deletions

View file

@ -5,7 +5,6 @@ function timestamp(str, ti) {
function collapse_comment(comment_id) {
const comment = document.getElementById(`comment-${comment_id}`)
const isClosed = comment.classList.contains("collapsed");
const top = comment.getBoundingClientRect().y;
const toggler = document.getElementById(`comment-collapse-${comment_id}`);
@ -14,6 +13,8 @@ function collapse_comment(comment_id) {
['items-center', 'opacity-50', 'hover:opacity-100', 'collapsed'].map(y=> comment.classList.toggle(y)); // apply flex alignment and opacity to comment parent wrapping div
const isClosed = comment.classList.contains("collapsed");
document.getElementById(`comment-toggle-icon-${comment_id}`).innerText = isClosed ? '[+]' : '[-]';
if (isClosed && top < 0) {