From 346defde8bffd64e7dbf30c1ff4bfde599465f19 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sat, 11 Oct 2025 09:19:51 +1100 Subject: [PATCH] added a functional (small) up button in the viewer, all works --- internal/icons.svg | 3 +++ internal/js/files_support.js | 16 ++++++++++-- templates/files.html | 50 ++++++++++++++++++++++-------------- 3 files changed, 48 insertions(+), 21 deletions(-) diff --git a/internal/icons.svg b/internal/icons.svg index cfb6b67..a1b1e21 100644 --- a/internal/icons.svg +++ b/internal/icons.svg @@ -208,4 +208,7 @@ + + + diff --git a/internal/js/files_support.js b/internal/js/files_support.js index be048f6..0af0ddd 100644 --- a/internal/js/files_support.js +++ b/internal/js/files_support.js @@ -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') +} diff --git a/templates/files.html b/templates/files.html index e5a3c2e..d3d4577 100644 --- a/templates/files.html +++ b/templates/files.html @@ -117,16 +117,22 @@
- + +
+ + + + +
@@ -146,15 +152,21 @@
- + +
+ + + + +
{# this whole div, just takes up the same space as the left button and is hidden for alignment only #}