From 67b1c0dd49d89d4c2b704d4a08e129039af4c109 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Thu, 16 Sep 2021 21:06:05 +1000 Subject: [PATCH] fix BUG-53 video/image viewer switching had spacing and name wrong --- BUGs | 1 - internal/js/view_support.js | 18 ++++++--- templates/viewer.html | 79 +++++++++++++++++++------------------ 3 files changed, 52 insertions(+), 46 deletions(-) diff --git a/BUGs b/BUGs index 7b70695..9a5763b 100644 --- a/BUGs +++ b/BUGs @@ -1,4 +1,3 @@ ### Next: 59 BUG-52: updated tag on person, and it said successful, but the colour was red/danger -BUG-53: when viewing list, moving to a video and the name of the file is not updated (are there 2 in the dom?) BUG-56: when making a viewing list of AI:mich, (any search?) and going past the page_size, it gets the wrong data from the DB for the 'next' entry diff --git a/internal/js/view_support.js b/internal/js/view_support.js index f02fa6e..2969116 100644 --- a/internal/js/view_support.js +++ b/internal/js/view_support.js @@ -51,12 +51,12 @@ function DrawImg() // show (or not) the whole figcaption with fname in it - based on state of fname_toggle if( $('#fname_toggle').prop('checked' ) ) { - $('.figcaption').attr('style', 'display:show' ) // reset fname for new image (if navigated left/right to get here) $('#fname').html(objs[current].name) + $('.figcaption').show() } else - $('.figcaption').attr('style', 'display:none' ) + $('.figcaption').hide() // if we have faces, the enable the toggles, otherwise disable them // and reset model select too @@ -154,8 +154,11 @@ function ViewImageOrVideo() if( objs[current].type == 'Image' ) { im.src='../' + objs[current].url - $('#video').hide() - $('#vid-caption').hide() + $('#video_div').hide() + //$('#vid-cap').hide() + if( $('#fname_toggle').prop('checked' ) ) + $('#img-cap').show() + $('#fname_i').html(objs[current].name) $('#figure').show() if( fullscreen ) $('#canvas').get(0).requestFullscreen() @@ -164,8 +167,11 @@ function ViewImageOrVideo() { $('#video').prop('src', '../' + objs[current].url ) $('#figure').hide() - $('#video').show() - $('#vid-caption').show() + $('#fname_v').html(objs[current].name) + if( $('#fname_toggle').prop('checked' ) ) + $('#img-cap').hide() + $('#video_div').show() + //$('#vid-cap').show() ResizeVideo() if( fullscreen ) $('#video').get(0).requestFullscreen() diff --git a/templates/viewer.html b/templates/viewer.html index 045f380..131afc6 100644 --- a/templates/viewer.html +++ b/templates/viewer.html @@ -117,52 +117,53 @@ var context = canvas.getContext('2d') window.addEventListener('resize', DrawImg, false); -
{{objs[current].name}}
+
{{objs[current].name}}
- {% if objs[current].type.name != "Image" %} - - {% endif %} -
- -
{{objs[current].name}}
+ {% if objs[current].type.name != "Image" %} + + {% endif %} +
+ +
+ {{objs[current].name}} +
-