forked from MarseyWorld/MarseyWorld
fdfd
parent
ac7bea37f3
commit
24bf6aeefe
|
@ -225,13 +225,21 @@
|
|||
|
||||
this.innerHTML='<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Reporting comment';
|
||||
this.disabled = true;
|
||||
post('/api/flag/comment/' + id,
|
||||
callback = function() {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", '/api/flag/comment/'+id, true);
|
||||
var form = new FormData()
|
||||
form.append("formkey", formkey());
|
||||
form.append("reason", document.getElementById("reason").value);
|
||||
|
||||
document.getElementById("reportCommentFormBefore").classList.add('d-none');
|
||||
document.getElementById("reportCommentFormAfter").classList.remove('d-none');
|
||||
}
|
||||
)
|
||||
xhr.withCredentials=true;
|
||||
|
||||
xhr.onload=function() {
|
||||
document.getElementById("reportCommentFormBefore").classList.add('d-none');
|
||||
document.getElementById("reportCommentFormAfter").classList.remove('d-none');
|
||||
};
|
||||
|
||||
xhr.onerror=function(){alert(errortext)};
|
||||
xhr.send(form);
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue