changeset 1031:e077f52205a7

autoBirdDiv option
author hertzhaft
date Fri, 09 Mar 2012 20:47:06 +0100
parents ef94924cc0c4
children 4e368c85cce4
files webapp/src/main/webapp/jquery/jquery.digilib.birdseye.js webapp/src/main/webapp/jquery/jquery.digilib.js
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/webapp/src/main/webapp/jquery/jquery.digilib.birdseye.js	Fri Mar 09 17:10:14 2012 +0100
+++ b/webapp/src/main/webapp/jquery/jquery.digilib.birdseye.js	Fri Mar 09 20:47:06 2012 +0100
@@ -23,6 +23,8 @@
     var defaults = {
             // is birdView shown?
             'isBirdDivVisible' : false,
+            // is birdView automatically shown for a zoomed image and hidden when not?
+            'autoBirdDiv' : false,
             // dimensions of bird's eye div
             'birdDivWidth' : 200, 
             'birdDivHeight' : 200,
--- a/webapp/src/main/webapp/jquery/jquery.digilib.js	Fri Mar 09 17:10:14 2012 +0100
+++ b/webapp/src/main/webapp/jquery/jquery.digilib.js	Fri Mar 09 20:47:06 2012 +0100
@@ -336,11 +336,11 @@
          * @param mode
          */
         zoomFull : function (data, mode) {
+            var settings = data.settings;
             data.zoomArea = FULL_AREA.copy();
             setFitMode(data, mode);
             // zoom full only works in screen mode
             setScaleMode(data, 'screen');
-            data.settings.isBirdDivVisible = false;
             redisplay(data);
         },
 
@@ -459,7 +459,6 @@
             var size = getFullscreenImgSize(data);
             settings.dw = params.dw || size.width;
             settings.dh = params.dh || size.height;
-            settings.isBirdDivVisible = false;
             settings.visibleButtonSets = 1; // FIXME
             // resets zoomArea, marks, scalerflags
             data.zoomArea = FULL_AREA.copy();
@@ -858,7 +857,10 @@
      * 
      */
     var redisplay = function (data) {
-        var settings = data.settings; 
+        var settings = data.settings;
+        if (settings.autoBirdDiv) {
+            settings.isBirdDivVisible = !isFullArea(data.zoomArea);
+            }
         if (settings.interactionMode === 'fullscreen') {
             // update location.href (browser URL) in fullscreen mode
             var url = getDigilibUrl(data);