diff --git a/files/templates/comments.html b/files/templates/comments.html index 340e24a86..600db3e52 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -38,9 +38,9 @@ -{% endif %} -{% include 'usernote.html' %} + {% include 'usernote.html' %} +{% endif %} {% macro single_comment(c, level=1) %} @@ -741,6 +741,16 @@ {% endfor %} +{% if offset %} + {% if p %} + {% set pid = p.id %} + {% endif %} +
+
+ +
+{% endif %} + {% if not ajax %} {% if v %} {% include "gif_modal.html" %} @@ -889,12 +899,4 @@ {% endif %} -{% if offset %} - {% if p %} - {% set pid = p.id %} - {% endif %} -
-
-{% endif %} - diff --git a/files/templates/submission.html b/files/templates/submission.html index 20cbb044e..35677f2d5 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -539,9 +539,11 @@ xhr.setRequestHeader('xhr', 'xhr'); xhr.onload=function(){ if (xhr.status==200) { - let e = document.getElementById(`viewmore-${offset}`); - e.innerHTML = xhr.response.replace(/data-src/g, 'src').replace(/data-cfsrc/g, 'src').replace(/style="display:none;visibility:hidden;"/g, ''); - bs_trigger(e) + const e = document.getElementById(`viewmore-${offset}`); + const html = xhr.response.replace(/data-src/g, "src").replace(/data-cfsrc/g, "src").replace(/style="display:none;visibility:hidden;"/g, ""); + const fragment = document.createRange().createContextualFragment(html); + bs_trigger(fragment); + e.replaceWith(fragment); comments = JSON.parse(localStorage.getItem("old-comment-counts")) || {} lastCount = comments['{{p.id}}']