changeset 707:bbe9606d1bdc jquery

was producing multiple copies of $bg
author hertzhaft
date Fri, 28 Jan 2011 17:01:27 +0100
parents f345b9657f5c
children 120ace160386
files client/digitallibrary/jquery/jquery.digilib.js
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/jquery/jquery.digilib.js	Fri Jan 28 16:29:54 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.js	Fri Jan 28 17:01:27 2011 +0100
@@ -289,6 +289,8 @@
                 }
                 // about window creation - TODO: could be deferred? restrict to only one item?
                 setupAboutDiv(data);
+                // TODO: the actual moving code    
+                setupZoomDrag(data);
             });
         },
 
@@ -689,6 +691,7 @@
         data.dlOpts.buttons = settings.visibleButtonSets;
 
         // save digilib options in cookie
+        // TODO: in embedded mode this is not called 
         if (data.dlOpts) {
             var clop = '';
             for (var o in data.dlOpts) {
@@ -1028,10 +1031,6 @@
             if ($birdImg) {
                 $birdImg.triggerHandler('load');
                 };
-                // TODO: the actual moving code    
-            if (!isFullArea(data.zoomArea)) {
-                setupZoomDrag(data);
-                };
         };
     };
 
@@ -1262,8 +1261,11 @@
         var $elem = data.$elem;
         var $scaler = data.$scaler;
         var $img = data.$img;
-        var $bg = $('<div class="bgDrag" style="display:none; position:absolute"/>');
-        $scaler.before($bg); // set as background
+        var $bg = $elem.has('div.bgDrag');
+        if ($bg.length === 0) {
+            $bg = $('<div class="bgDrag" style="display:none; position:absolute"/>');
+            $scaler.before($bg); // set as background
+            };
         
         var dragStart = function (evt) {
         // drag the image and load a new detail on mouse up