diff --git a/files/assets/js/comments_v.js b/files/assets/js/comments_v.js index 1ff38cdfb..45ea4fe46 100644 --- a/files/assets/js/comments_v.js +++ b/files/assets/js/comments_v.js @@ -231,26 +231,19 @@ function post_comment(fullname, hide){ try {data = JSON.parse(xhr.response)} catch(e) {console.log(e)} if (data && data["comment"]) { - document.getElementById(hide).classList.add('d-none'); + if (hide) document.getElementById(hide).classList.add('d-none'); let id = fullname.split('_')[1]; let name = 'comment-form-space-' + fullname; commentForm = document.getElementById(name); - let comments = document.getElementById('replies-of-' + id); + let comments = document.getElementById('replies-of-' + fullname); let comment = data["comment"].replace(/data-src/g, 'src').replace(/data-cfsrc/g, 'src').replace(/style="display:none;visibility:hidden;"/g, ''); comments.innerHTML = comment + comments.innerHTML; bs_trigger(commentForm); - let placeholder = document.getElementById("placeholder-comment"); - if(placeholder){ - comments.classList.remove('text-center'); - comments.classList.remove('py-7'); - placeholder.parentNode.removeChild(placeholder); - } - btn.disabled = false; btn.classList.remove('disabled'); diff --git a/files/templates/comments.html b/files/templates/comments.html index 95851c987..d75e97702 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -89,7 +89,7 @@ {% if render_replies %} {% if level<9 or request.path.startswith('/notifications') or request.headers.get("xhr") %} -
+
{% for reply in replies %} {{single_comment(reply, level=level+1)}} {% endfor %} @@ -598,7 +598,7 @@ {% if render_replies %} {% if level<9 or request.path.startswith('/notifications') or request.headers.get("xhr") %} -
+
{% for reply in replies %} {{single_comment(reply, level=level+1)}} {% endfor %} @@ -636,7 +636,7 @@
{% endif %} {% else %} -
+
{% endif %}
@@ -864,7 +864,7 @@ {% if v %} - + {% endif %} diff --git a/files/templates/submission.html b/files/templates/submission.html index c1bd769a4..e795ebbd8 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -1004,7 +1004,7 @@
- Comment + Comment
Formatting help
@@ -1026,51 +1026,50 @@
{% endif %} - {% if p.replies %} -
+{% if p.replies %} +
{% with comments=p.replies %} {% include "comments.html" %} - {% endwith %} -
- -{% if offset %} - -{% endif %} - + + {% endif %} {% elif not p.replies and p.deleted_utc == 0 %} -
+