changeset 722:73cac710bea4 jquery

still the strange bug when dragging the zoomed image in embedded mode
author hertzhaft
date Mon, 31 Jan 2011 16:22:39 +0100
parents dccff3759699
children c6878e9575fe
files client/digitallibrary/jquery/jquery.digilib.js
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/jquery/jquery.digilib.js	Mon Jan 31 13:34:32 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.js	Mon Jan 31 16:22:39 2011 +0100
@@ -785,7 +785,7 @@
             var url = getScalerUrl(data);
             data.$img.attr('src', url);
             // load new bird img (in case the scalerUrl has changed, like in gotopage)
-            showBirdDiv(data);
+            showBirdImage(data);
             }
     };
 
@@ -840,9 +840,6 @@
         // setup image load handler before setting the src attribute (IE bug)
         $img.load(scalerImgLoadedHandler(data));
         $img.attr('src', scalerUrl);
-        // set scaler div size explicitly in case $img is hidden (for zoomDrag)
-        $imgRect = geom.rectangle($img);
-        $imgRect.adjustDiv(data.$scaler); 
     };
 
     // creates HTML structure for buttons in elem
@@ -927,15 +924,16 @@
         data.$birdZoom = $birdZoom;
         data.$birdImg = $birdImg;
         $birdImg.load(birdImgLoadedHandler(data));
-        showBirdDiv(data);
+        showBirdImage(data);
         birdZoom(data);
     };
     
     // puts correct img into bird div
-    var showBirdDiv = function (data) {
+    var showBirdImage = function (data) {
+        var $birdDiv = data.$birdDiv;
+        if ($birdDiv == null) return null;
         var settings = data.settings;
         var $birdImg = data.$birdImg;
-        var $birdDiv = data.$birdDiv;
         var birdDivOptions = {
             dw : settings.birdDivWidth,
             dh : settings.birdDivHeight
@@ -1350,6 +1348,7 @@
         var dragEnd = function (evt) {
         // mouseup handler: reload zoomed image in new position
             $scaler.css({
+                'background-image' : 'none',
                 'cursor' : 'default'
                 });
             $(document).unbind("mousemove.digilib", dragMove);