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

This commit is contained in:
2024-06-29 13:53:38 +10:00
parent 1277558b0e
commit 030eb785f3

View File

@@ -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 )
{