changeset 720:4f96149cf584 jquery

adjust size of scalerDiv only when img loaded
author hertzhaft
date Mon, 31 Jan 2011 10:16:30 +0100
parents 3da6db751448
children dccff3759699
files client/digitallibrary/jquery/jquery.digilib.js
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/jquery/jquery.digilib.js	Mon Jan 31 10:05:49 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.js	Mon Jan 31 10:16:30 2011 +0100
@@ -784,9 +784,6 @@
             // embedded mode -- just change img src
             var url = getScalerUrl(data);
             data.$img.attr('src', url);
-            // set scaler div size explicitly in case $img is hidden (for zoomDrag)
-            $imgRect = geom.rectangle(data.$img);
-            $imgRect.adjustDiv(data.$scaler);
             // load new bird img (in case the scalerUrl has changed, like in gotopage)
             showBirdDiv(data);
             }
@@ -1075,6 +1072,10 @@
             data.imgTrafo = getImgTrafo($img, data.zoomArea,
                     data.settings.rot, data.scalerFlags.hmir, data.scalerFlags.vmir);
             console.debug("imgTrafo=", data.imgTrafo);
+            // set scaler div size explicitly in case $img is hidden (for zoomDrag)
+            var $imgRect = geom.rectangle(data.$img);
+            console.debug("imgrect=", $imgRect);
+            $imgRect.adjustDiv(data.$scaler);
             // show image in case it was hidden (for example in zoomDrag)
             $img.show();
             // display marks