make delete/restore button in viewer be the right colour, and go back to / when the success for the delete or restore finishes

This commit is contained in:
2025-10-10 23:13:03 +11:00
parent fa2197adbe
commit b51d9e1776
3 changed files with 28 additions and 17 deletions

View File

@@ -177,7 +177,7 @@ function DelDBox(del_or_undel)
div+=`
'/delete_files',
success: function(data){
if( $(location).attr('pathname').match('search') !== null ) { window.location='/' }; CheckForJobs() } }); return false" class="btn btn-outline-danger col-2">Ok</button>
if( $(location).attr('pathname').match('search') !== null || document.viewing ) { window.location='/' }; CheckForJobs() } }); return false" class="btn btn-outline-danger col-2">Ok</button>
</div>
`
else
@@ -186,7 +186,7 @@ function DelDBox(del_or_undel)
div+=`
'/restore_files',
success: function(data){
if( $(location).attr('pathname').match('search') !== null ) { window.location='/' }; CheckForJobs() } }); return false" class="btn btn-outline-success col-2">Ok</button>
if( $(location).attr('pathname').match('search') !== null || document.viewing ) { window.location='/' }; CheckForJobs() } }); return false" class="btn btn-outline-success col-2">Ok</button>
</div>
`
$('#dbox-content').html(div)