changeset 1016:168e8aa7e9a5

get rid of another callback loop
author hertzhaft
date Sat, 18 Feb 2012 19:57:04 +0100
parents 5b7fd3515e4c
children c3931ec5485f
files webapp/src/main/webapp/jquery/jquery.digilib.birdseye.js
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/webapp/src/main/webapp/jquery/jquery.digilib.birdseye.js	Sat Feb 18 19:25:03 2012 +0100
+++ b/webapp/src/main/webapp/jquery/jquery.digilib.birdseye.js	Sat Feb 18 19:57:04 2012 +0100
@@ -170,14 +170,15 @@
             var $birdImg = $(this);
             var birdRect = geom.rectangle($birdImg);
             console.debug("birdImg loaded!", $birdImg, "rect=", birdRect, "data=", data);
-            if (birdRect.width === 0) {
-                // malheureusement IE7 calls load handler when there is no size info yet 
-                setTimeout(function () { $birdImg.triggerHandler('load'); }, 200);
-                }
             // create Transform from current area and picsize
             data.birdTrafo = digilib.fn.getImgTrafo(data.$birdImg, FULL_AREA);
             // update display (zoom area indicator)
             if (data.settings.isBirdDivVisible) {
+                if (birdRect.width === 0) {
+                    // workaround: IE7 calls load handler when there is no size info yet 
+                    setTimeout(function () { $birdImg.triggerHandler('load'); }, 200);
+                    return;
+                    }
                 renderBirdArea(data);
                 }
         };