Fix typo (min vs max)
authorMichael Ang <mang@archive.org>
Thu, 6 Aug 2009 22:39:47 +0000 (22:39 +0000)
committerMichael Ang <mang@archive.org>
Thu, 6 Aug 2009 22:39:47 +0000 (22:39 +0000)
GnuBook/GnuBook.js

index a1f0beb..30cb648 100644 (file)
@@ -570,7 +570,7 @@ GnuBook.prototype.resizePageView = function() {
     // We use clientWidth here to avoid miscalculating due to scroll bar
     var newCenterX = oldCenterX * (viewWidth / oldPageViewWidth);
     var newLeft = newCenterX - $('#GBcontainer').attr('clientWidth') / 2;
-    newLeft = Math.min(newLeft, 0);
+    newLeft = Math.max(newLeft, 0);
     $('#GBcontainer').attr('scrollLeft', newLeft);
     //console.log('oldCenterX ' + oldCenterX + ' newCenterX ' + newCenterX + ' newLeft ' + newLeft);