From 030eb785f3e55df9329bb1d890ad87d028b04403 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sat, 29 Jun 2024 13:53:38 +1000 Subject: [PATCH] Fix BUG-126 (basically disable next/prev buttons the moment we go back to the server for the previous/next page of images, only re-enable if they make sense after we have loaded the new images --- templates/viewer.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/templates/viewer.html b/templates/viewer.html index 6e663c3..f9576a7 100644 --- a/templates/viewer.html +++ b/templates/viewer.html @@ -101,6 +101,9 @@ function CallViewListRoute(dir) { + // dont allow mad spamming of arrows + $("#la").prop("disabled", true) + $("#ra").prop("disabled", true) data="eids="+$("#eids").val() data+="&cwd={{OPT.cwd}}" data+="&root={{OPT.root}}" @@ -117,10 +120,11 @@ objs=res.objs eid_lst=eids.split(",") offset=res.offset - if( current == first_eid ) - $("#la").prop("disabled", true) - if( current == last_eid ) - $("#ra").prop("disabled", true) + // okay, we now have results back, can reset next/prev buttons + if( current != first_eid ) + $("#la").prop("disabled", false) + if( current != last_eid ) + $("#ra").prop("disabled", false) ViewImageOrVideo() } }) @@ -207,7 +211,7 @@ $('#la').attr('disabled', false ) } else - CallViewListRoute('next') + CallViewListRoute('next') if( current == last_eid ) {