diff --git a/files/assets/js/comments_v.js b/files/assets/js/comments_v.js index 9f53147b2..a704001b4 100644 --- a/files/assets/js/comments_v.js +++ b/files/assets/js/comments_v.js @@ -91,26 +91,6 @@ document.getElementById("reportCommentButton").onclick = function() { }; -document.addEventListener("DOMContentLoaded", function () { - - document.getElementById('reportCommentModal').addEventListener('hidden.bs.modal', function () { - - var button = document.getElementById("reportCommentButton"); - - var beforeModal = document.getElementById("reportCommentFormBefore"); - var afterModal = document.getElementById("reportCommentFormAfter"); - - button.innerHTML = 'Report comment'; - button.disabled = false; - afterModal.classList.add('d-none'); - - if (beforeModal.classList.contains('d-none')) { - beforeModal.classList.remove('d-none'); - } - - }); -}) - function openReplyBox(id) { const element = document.getElementById(`reply-to-${id}`); element.classList.remove('d-none') @@ -178,6 +158,9 @@ post_reply=function(id){ document.getElementById('save-reply-to-'+id).classList.add('disabled'); + document.querySelectorAll('[data-src]').forEach(elem => { + elem.src = elem.dataset.src; + }) } comment_edit=function(id){ @@ -211,6 +194,9 @@ comment_edit=function(id){ } xhr.send(form) + document.querySelectorAll('[data-src]').forEach(elem => { + elem.src = elem.dataset.src; + }) } post_comment=function(fullname){ diff --git a/files/assets/js/report_post_modal.js b/files/assets/js/report_post_modal.js index 281504c63..9f8de416c 100644 --- a/files/assets/js/report_post_modal.js +++ b/files/assets/js/report_post_modal.js @@ -24,22 +24,4 @@ report_postModal = function(id) { xhr.send(form); } -}; - -document.getElementById('reportPostModal').addEventListener('hidden.bs.modal', function () { - - var button = document.getElementById("reportPostButton"); - - var beforeModal = document.getElementById("reportPostFormBefore"); - var afterModal = document.getElementById("reportPostFormAfter"); - - button.innerHTML='Report post'; - button.disabled= false; - - afterModal.classList.add('d-none'); - - if ( beforeModal.classList.contains('d-none') ) { - beforeModal.classList.remove('d-none'); - } - -}); +}; \ No newline at end of file diff --git a/files/templates/comments.html b/files/templates/comments.html index 239db932a..dd0f48e76 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -33,7 +33,7 @@ {% if v %} {% include "award_modal.html" %} - + {% endif %} diff --git a/files/templates/report_post_modal.html b/files/templates/report_post_modal.html index cf5b8c732..798f0d724 100644 --- a/files/templates/report_post_modal.html +++ b/files/templates/report_post_modal.html @@ -1,4 +1,4 @@ - +