changeset 1608:ee7793447172

reset imgInfo when image changes. about window is redrawn every time.
author robcast
date Mon, 06 Mar 2017 21:01:52 +0100
parents 852f775d935b
children 3f3a4f4eecb1
files webapp/src/main/webapp/jquery/jquery.digilib.js
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/webapp/src/main/webapp/jquery/jquery.digilib.js	Mon Mar 06 20:28:24 2017 +0100
+++ b/webapp/src/main/webapp/jquery/jquery.digilib.js	Mon Mar 06 21:01:52 2017 +0100
@@ -303,7 +303,8 @@
             var cssPrefix = settings.cssPrefix;
             var aboutSelector = '#'+cssPrefix+'about';
             if (isOnScreen(data, aboutSelector)) {
-                $(aboutSelector).fadeToggle();
+            	// fade out and kill, so we can re-render with new info
+                $(aboutSelector).fadeOut(function () {$(this).remove()});
                 return;
             }
             // make relative logoUrl absolute
@@ -311,6 +312,7 @@
             if (logoUrl.charAt(0) !== '/' && logoUrl.substring(0,3) !== 'http') {
                 logoUrl = settings.digilibBaseUrl + '/' + logoUrl;
             }
+            // add image info if available
             var imgInfoDiv = '';
             if (data.imgInfo != null) {
             	var info = data.imgInfo;
@@ -386,8 +388,10 @@
                     return false;
                     }
                 }
-            // reset mk and others(?)
+            // reset mk and others 
+            // TODO: should be event
             data.marks = [];
+            data.imgInfo = null;
             data.zoomArea = FULL_AREA.copy();
             // then reload
             redisplay(data);