changeset 677:0233e39305d3 jquery

took renderBirdArea hooks out of scalerImgLoaded into redisplay. still some problems with displaying bird zoom area
author robcast
date Tue, 25 Jan 2011 23:58:27 +0100
parents d1605eb99d74
children d50d24b7fd95
files client/digitallibrary/jquery/jquery.digilib.js
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/jquery/jquery.digilib.js	Tue Jan 25 22:28:48 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.js	Tue Jan 25 23:58:27 2011 +0100
@@ -612,7 +612,11 @@
             // embedded mode -- just change img src
             var url = getScalerUrl(data);
             data.$img.attr('src', url);
-            };
+            // and update bird's eye view
+            if (settings.isBirdDivVisible) {
+                renderBirdArea(data);
+            }
+        };
     };
 
     // returns maximum size for scaler img in fullscreen mode
@@ -741,6 +745,7 @@
         $birdzoomDiv.css(data.settings.birdIndicatorStyle);
         data.$birdDiv = $birdDiv;
         data.$birdImg = $birdImg;
+        data.$birdZoom = $birdzoomDiv;
         $birdImg.load(birdImgLoadedHandler(data));
         $birdImg.attr('src', birdUrl);
         if (data.settings.isBirdDivVisible) {
@@ -834,10 +839,10 @@
             // display marks
             renderMarks(data);
             //digilib.showArrows(); // show arrow overlays for zoom navigation
-            var $birdImg = data.$birdImg;
+            /* var $birdImg = data.$birdImg;
             if ($birdImg) {
                 $birdImg.triggerHandler('load');
-                };
+                }; */
         };
     };
 
@@ -845,8 +850,7 @@
     var birdImgLoadedHandler = function (data) {
         var $img = data.$birdImg;
         return function () {
-            if (!$img) return;
-            // console.debug("birdimg loaded! this=", this, " data=", data);
+            console.debug("birdimg loaded! this=", this, " data=", data);
             // create Transform from current area and picsize
             data.birdTrafo = getImgTrafo($img, MAX_ZOOMAREA);
             // display red indicator around zoomarea
@@ -873,8 +877,9 @@
         }
     };
 
+    // show zoom area indicator on bird's eye view
     var renderBirdArea = function (data) {
-        var $birdzoom = data.$birdDiv.find('div.birdzoom');
+        var $birdzoom = data.$birdZoom;
         var zoomArea = data.zoomArea;
         var indRect = data.birdTrafo.transform(zoomArea);
         var coords = {