Preserve left/right position when zoomed in and jumping to index.
authorMichael Ang <mang@archive.org>
Thu, 20 May 2010 21:42:22 +0000 (21:42 +0000)
committerMichael Ang <mang@archive.org>
Thu, 20 May 2010 21:42:22 +0000 (21:42 +0000)
BookReader/BookReader.js

index bd12273..fbaa8b9 100644 (file)
@@ -1235,6 +1235,9 @@ BookReader.prototype.jumpToIndex = function(index, pageX, pageY) {
             var offset = parseInt( (pageX) / this.reduce);
             offset -= $('#BRcontainer').attr('clientWidth') >> 1;
             leafLeft += offset;
+        } else {
+            // Preserve left position
+            leafLeft = $('#BRcontainer').scrollLeft();
         }
 
         //$('#BRcontainer').attr('scrollTop', leafTop);