allow ppl to reply to DMs multiple times without refreshing

remotes/1693045480750635534/spooky-22
Aevann1 2022-09-20 21:06:26 +02:00
parent 6f28acf4ae
commit 25c6673f5c
2 changed files with 14 additions and 4 deletions

View File

@ -152,9 +152,19 @@ function post_reply(id){
try {data = JSON.parse(xhr.response)}
catch(e) {console.log(e)}
if (data && data["comment"]) {
commentForm=document.getElementById('comment-form-space-'+id);
commentForm.innerHTML = data["comment"].replace(/data-src/g, 'src').replace(/data-cfsrc/g, 'src').replace(/style="display:none;visibility:hidden;"/g, '').replace('comment-collapse-desktop d-none d-md-block','d-none').replace('border-left: 2px solid','padding-left:0;border-left: 0px solid');
bs_trigger(commentForm);
const comments = document.getElementById('replies-of-c_' + id);
const comment = data["comment"].replace(/data-src/g, 'src').replace(/data-cfsrc/g, 'src').replace(/style="display:none;visibility:hidden;"/g, '');
comments.innerHTML = comments.innerHTML + comment;
bs_trigger(comments);
btn.disabled = false;
btn.classList.remove('disabled');
document.getElementById('reply-form-body-'+id).value = ''
document.getElementById('message-reply-'+id).innerHTML = ''
ToggleReplyBox('reply-message-'+id)
}
else {
if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"];

View File

@ -18,7 +18,7 @@ set CACHE_VER = {
'js/award_modal.js': 4001,
'js/bootstrap.js': 4006,
'js/comments_admin.js': 4000,
'js/comments_v.js': 4002,
'js/comments_v.js': 4003,
'js/submission_listing.js': 4000,
'js/emoji_modal.js': 4004,
'js/formatting.js': 4000,