dffd
This commit is contained in:
parent
04ff974b32
commit
832250f210
1 changed files with 7 additions and 14 deletions
|
@ -219,26 +219,19 @@
|
||||||
|
|
||||||
document.getElementById("comment-author").textContent = author;
|
document.getElementById("comment-author").textContent = author;
|
||||||
|
|
||||||
|
//offtopic.disabled=true;
|
||||||
|
|
||||||
document.getElementById("reportCommentButton").onclick = function() {
|
document.getElementById("reportCommentButton").onclick = function() {
|
||||||
|
|
||||||
this.innerHTML='<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Reporting comment';
|
this.innerHTML='<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Reporting comment';
|
||||||
this.disabled = true;
|
this.disabled = true;
|
||||||
var xhr = new XMLHttpRequest();
|
post('/api/flag/comment/' + id,
|
||||||
xhr.open("POST", '/api/flag/comment/'+id, true);
|
callback = function() {
|
||||||
var form = new FormData()
|
|
||||||
form.append("formkey", formkey());
|
|
||||||
form.append("reason", document.getElementById("reason").value);
|
|
||||||
|
|
||||||
xhr.withCredentials=true;
|
document.getElementById("reportCommentFormBefore").classList.add('d-none');
|
||||||
|
document.getElementById("reportCommentFormAfter").classList.remove('d-none');
|
||||||
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…
Add table
Add a link
Reference in a new issue