diff --git a/files/assets/js/comments.js b/files/assets/js/comments.js index e5018b8a7..4c14db065 100644 --- a/files/assets/js/comments.js +++ b/files/assets/js/comments.js @@ -2,13 +2,13 @@ function poll_vote_no_v() { showToast(false, "Only logged-in users can vote!"); } -function expandMarkdown(id,type) { - const ta = document.getElementById('markdown-'+id); +function expandMarkdown(fullname) { + const ta = document.getElementById('markdown-'+fullname); ta.classList.toggle('d-none'); - document.getElementsByClassName('text-expand-icon-'+id)[0].classList.toggle('fa-expand-alt'); - document.getElementsByClassName('text-expand-icon-'+id)[0].classList.toggle('fa-compress-alt'); + document.getElementsByClassName('text-expand-icon-'+fullname)[0].classList.toggle('fa-expand-alt'); + document.getElementsByClassName('text-expand-icon-'+fullname)[0].classList.toggle('fa-compress-alt'); - const items = document.getElementsByClassName(`expand-text-${type}-${id}`) + const items = document.getElementsByClassName(`expand-text-${fullname}`) for (let i=0; i < items.length; i++) { const e = items[i] @@ -36,7 +36,7 @@ function collapse_comment(id) { vids[i].pause() } - const ta = document.getElementById('markdown-'+id); + const ta = document.getElementById('markdown-c_'+id); if (!ta.classList.contains('d-none')) - expandMarkdown(id,'c') + expandMarkdown(`c_${id}`) }; diff --git a/files/assets/js/submission_listing.js b/files/assets/js/submission_listing.js index ce33a9958..809d2b11e 100644 --- a/files/assets/js/submission_listing.js +++ b/files/assets/js/submission_listing.js @@ -1,6 +1,6 @@ function expandText(id) { document.getElementById('post-text-'+id).classList.toggle('d-none'); - for (const e of document.getElementsByClassName('text-expand-icon-'+id)) + for (const e of document.getElementsByClassName('text-expand-icon-p_'+id)) { e.classList.toggle('fa-expand-alt'); e.classList.toggle('fa-compress-alt'); diff --git a/files/templates/comments.html b/files/templates/comments.html index 12f4fbd53..0513ef5ae 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -408,7 +408,7 @@ {% elif v and c.body %} - + {% endif %} {% endif %} @@ -492,7 +492,7 @@ {% if v and v.id != c.author_id and c.body %} -