From a628d59c03a0b824d5517fb13be97f931e542f83 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Wed, 26 Jul 2023 12:04:12 -0500 Subject: [PATCH] fix delete post and delete comment modals --- files/assets/js/comments_v.js | 4 ++-- files/assets/js/delete_post_modal.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/files/assets/js/comments_v.js b/files/assets/js/comments_v.js index eac0d8dba..c35b4241e 100644 --- a/files/assets/js/comments_v.js +++ b/files/assets/js/comments_v.js @@ -87,7 +87,7 @@ function toggleEdit(id){ function delete_commentModal(id) { - document.getElementById("deleteCommentButton").onclick = postToast(null, `/delete/comment/${id}`, 'POST', null, (xhr) => { + document.getElementById("deleteCommentButton").onclick = () => { postToast(null, `/delete/comment/${id}`, 'POST', null, (xhr) => { if (xhr.status >= 200 && xhr.status < 300) { document.getElementsByClassName(`comment-${id}-only`)[0].classList.add('deleted'); document.getElementById(`delete-${id}`).classList.add('d-none'); @@ -95,7 +95,7 @@ function delete_commentModal(id) { document.getElementById(`delete2-${id}`).classList.add('d-none'); document.getElementById(`undelete2-${id}`).classList.remove('d-none'); } - }); + })}; } function post_reply(id){ diff --git a/files/assets/js/delete_post_modal.js b/files/assets/js/delete_post_modal.js index bef000c33..03e412c1f 100644 --- a/files/assets/js/delete_post_modal.js +++ b/files/assets/js/delete_post_modal.js @@ -1,5 +1,5 @@ function delete_postModal(id) { - document.getElementById("deletePostButton").onclick = postToast(null, `/delete_post/${id}`, 'POST', null, (xhr) => { + document.getElementById("deletePostButton").onclick = () => postToast(null, `/delete_post/${id}`, 'POST', null, (xhr) => { if (xhr.status >= 200 && xhr.status < 300) { document.getElementById(`post-${id}`).classList.add('deleted'); document.getElementById(`delete-${id}`).classList.add('d-none'); @@ -7,5 +7,5 @@ function delete_postModal(id) { document.getElementById(`delete2-${id}`).classList.add('d-none'); document.getElementById(`undelete2-${id}`).classList.remove('d-none'); } - }); + })}; }