changeset 680:8ce4ec381f87 jquery

correct bindings for birdview
author hertzhaft
date Wed, 26 Jan 2011 01:35:56 +0100
parents f774b56d3c1a
children a6dfb2f2fd22
files client/digitallibrary/jquery/jquery.digilib.js
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/jquery/jquery.digilib.js	Wed Jan 26 01:26:45 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.js	Wed Jan 26 01:35:56 2011 +0100
@@ -1031,8 +1031,10 @@
         var birdZoomEndDrag = function(evt) {
             // mouseup handler: reload page
             var settings = data.settings;
-            $birdImg.unbind("mousemove.digilib", birdZoomMove);
-            $birdImg.unbind("mouseup.digilib", birdZoomEndDrag);
+            $(document).unbind("mousemove.digilib", birdZoomMove);
+            $(document).unbind("mouseup.digilib", birdZoomEndDrag);
+            $birdZoom.unbind("mousemove.digilib", birdZoomMove);
+            $birdZoom.unbind("mouseup.digilib", birdZoomEndDrag);
             if (newRect == null) { // no movement happened
                 startPos = birdZoomRect.getCenter();
                 birdZoomMove(evt); // set center to click position
@@ -1054,13 +1056,15 @@
             startPos = geom.position(evt);
             birdImgRect = geom.rectangle($birdImg);
             birdZoomRect = geom.rectangle($birdZoom);
-            $birdImg.bind("mousemove.digilib", birdZoomMove);
-            $birdImg.bind("mouseup.digilib", birdZoomEndDrag);
+            $(document).bind("mousemove.digilib", birdZoomMove);
+            $(document).bind("mouseup.digilib", birdZoomEndDrag);
+            $birdZoom.bind("mousemove.digilib", birdZoomMove);
+            $birdZoom.bind("mouseup.digilib", birdZoomEndDrag);
             return false;
         };
 
         $birdImg.one("mousedown.digilib", birdZoomStartDrag);
-        // $birdZoom.one("mousedown.digilib", birdZoomStartDrag);
+        $birdZoom.one("mousedown.digilib", birdZoomStartDrag);
     };
 
     // sets a key to a value (relative values with +/- if relative=true)