If there won't be scrollbars in a direction when zooming (out) center the book in...
authorMichael Ang <mang@archive.org>
Fri, 14 Aug 2009 00:48:12 +0000 (00:48 +0000)
committerMichael Ang <mang@archive.org>
Fri, 14 Aug 2009 00:48:12 +0000 (00:48 +0000)
GnuBook/GnuBook.js

index 287b434..16df10a 100644 (file)
@@ -662,10 +662,10 @@ GnuBook.prototype.zoom2up = function(direction) {
     // If there will not be scrollbars (e.g. when zooming out) we center the book
     // since otherwise the book will be stuck off-center
     if (this.twoPage.totalWidth < $('#GBcontainer').attr('clientWidth')) {
-        percentageX = 0.5;
+        oldCenter.percentageX = 0.5;
     }
     if (this.twoPage.totalHeight < $('#GBcontainer').attr('clientHeight')) {
-        percentageY = 0.5;
+        oldCenter.percentageY = 0.5;
     }
     this.twoPageCenterView(oldCenter.percentageX, oldCenter.percentageY);
 }