changeset 708:120ace160386 jquery

img reload works for fullscreen, but somehow not precise
author hertzhaft
date Fri, 28 Jan 2011 19:50:50 +0100
parents bbe9606d1bdc
children fca26721e8dd
files client/digitallibrary/jquery/jquery-test-full.html client/digitallibrary/jquery/jquery.digilib.js
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/jquery/jquery-test-full.html	Fri Jan 28 17:01:27 2011 +0100
+++ b/client/digitallibrary/jquery/jquery-test-full.html	Fri Jan 28 19:50:50 2011 +0100
@@ -70,6 +70,10 @@
                 display: none;
                 z-index: 1000;
                 }
+                
+            div.bgDrag {
+                background-color: grey;
+                }
 
         </style>
 
--- a/client/digitallibrary/jquery/jquery.digilib.js	Fri Jan 28 17:01:27 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.js	Fri Jan 28 19:50:50 2011 +0100
@@ -1310,14 +1310,16 @@
             $(document).unbind("mousemove.digilib", dragMove);
             $(document).unbind("mouseup.digilib", dragEnd);
             // calculate relative offset
-            var x = -dx / $img.width();
-            var y = -dy / $img.height();
             if (dx == 0 && dy == 0)
                 return false // no movement
             // reload with scaler image showing the new ausschnitt
+            // digilib.moveBy(x, y);
+            var pos = geom.position(-dx, -dy);
+            var newPos = data.imgTrafo.invtransform(pos);
+            var newArea = data.zoomArea.setPt1(newPos);
+            data.zoomArea = MAX_ZOOMAREA.fit(newArea);
             $bg.hide(); 
-            $img.show();
-            // digilib.moveBy(x, y);
+            redisplay(data);
             return false;
             };