added a functional (small) up button in the viewer, all works

This commit is contained in:
2025-10-11 09:19:51 +11:00
parent 6419e20d7e
commit 346defde8b
3 changed files with 48 additions and 21 deletions

View File

@@ -580,7 +580,7 @@ function getPage(pageNumber, successCallback, viewingIdx=0)
dataType: 'json',
success: function(res) {
document.entries=res;
successCallback(res,viewingIdx);
successCallback(res,viewingIdx)
resetNextPrevButtons()
// if search, disable folders
if( OPT.search_term )
@@ -710,7 +710,6 @@ function changeOPT(successCallback) {
// put data back into booleans, ints, etc
OPT.folders=( OPT.folders == 'True' )
OPT.how_many=parseInt(OPT.how_many)
console.log('OPT.size='+OPT.size)
$('.how_many_text').html( ` ${OPT.how_many} files ` )
OPT.root_eid=parseInt(OPT.root_eid)
OPT.size=parseInt(OPT.size)
@@ -924,3 +923,16 @@ $.contextMenu({
};
}
});
// quick function that allows us to go out of the viewer and back, the viewercomes from files_ip/sp
// so just redraw the page with drawPageOfFigures() as we have all the data
function goOutOfViewer()
{
// if this returns -1, we have used arrows to go onto a new page(s)
if( getPageNumberForId( $('#figures').find('.figure').first().prop('id') ) == -1 )
drawPageOfFigures()
// hide viewer div, then show files_div
$('#viewer_div').addClass('d-none')
$('#files_div').removeClass('d-none')
}