This commit is contained in:
kek7198 2021-12-09 18:16:02 -06:00
parent 5fd8b9de28
commit 33bd5a2097
2 changed files with 1 additions and 11 deletions

View file

@ -5,19 +5,9 @@ function timestamp(str, ti) {
function collapse_comment(comment_id) { function collapse_comment(comment_id) {
const comment = document.getElementById(`comment-${comment_id}`) const comment = document.getElementById(`comment-${comment_id}`)
const text = document.getElementById(`comment-text-${comment_id}`)
const actions = document.getElementById(`comment-${comment_id}-actions`)
const repliesOf = document.getElementById(`replies-of-${comment_id}`)
const toggler = document.getElementById(`comment-collapse-lg-${comment_id}`)
const isClosed = comment.classList.contains("collapsed"); const isClosed = comment.classList.contains("collapsed");
const top = comment.getBoundingClientRect().y; const top = comment.getBoundingClientRect().y;
const arr = [text, actions, repliesOf, toggler];
arr.map(x => x.classList.toggle('hidden')); // hide comment elements
['items-center', 'opacity-50', 'collapsed'].map(y=> comment.classList.toggle(y)); // apply flex alignment and opacity to comment parent wrapping div ['items-center', 'opacity-50', 'collapsed'].map(y=> comment.classList.toggle(y)); // apply flex alignment and opacity to comment parent wrapping div
if (isClosed && top < 0) { if (isClosed && top < 0) {

View file

@ -37,7 +37,7 @@
{% endif %} {% endif %}
<script defer src="/assets/js/popover.js?v=16"></script> <script defer src="/assets/js/popover.js?v=16"></script>
<script defer src="/assets/js/comments.js?v=15"></script> <script defer src="/assets/js/comments.js?v=16"></script>
{% include "expanded_image_modal.html" %} {% include "expanded_image_modal.html" %}