Update JS to clean up reporting UI after addressing
This commit is contained in:
parent
a973677ff9
commit
60084e5eef
1 changed files with 17 additions and 4 deletions
|
@ -8,14 +8,27 @@ function filter_new_status(id, new_status) {
|
||||||
.then(json => {
|
.then(json => {
|
||||||
if(json.result === 'Update successful') {
|
if(json.result === 'Update successful') {
|
||||||
const postRow = document.getElementById(`post-${id}`);
|
const postRow = document.getElementById(`post-${id}`);
|
||||||
if(document.location.pathname === '/admin/filtered_submissions') {
|
if(document.location.pathname === '/admin/filtered_submissions' || document.location.pathname === '/admin/reported/posts' ) {
|
||||||
postRow.parentElement.removeChild(postRow);
|
postRow.parentElement.removeChild(postRow);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
const approveLink = postRow.querySelector('a#filter-approve')
|
const approveLink = postRow.querySelector('a#filter-approve')
|
||||||
const removeLink = postRow.querySelector('a#filter-remove')
|
const removeLink = postRow.querySelector('a#filter-remove')
|
||||||
|
if(approveLink && removeLink) {
|
||||||
approveLink.parentElement.removeChild(approveLink);
|
approveLink.parentElement.removeChild(approveLink);
|
||||||
removeLink.parentElement.removeChild(removeLink);
|
removeLink.parentElement.removeChild(removeLink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const reportButtonCell = document.getElementById(`flaggers-${id}`);
|
||||||
|
if(reportButtonCell) {
|
||||||
|
reportButtonCell.classList.add('d-none')
|
||||||
|
}
|
||||||
|
|
||||||
|
const reportButton = document.getElementById(`report-btn-${id}`);
|
||||||
|
if(reportButton) {
|
||||||
|
reportButton.parentElement.removeChild(reportButton);
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById('toast-post-success-text').innerText = json.result;
|
document.getElementById('toast-post-success-text').innerText = json.result;
|
||||||
bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-success')).show();
|
bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-success')).show();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue