X-Git-Url: http://git.rot13.org/?p=bookreader.git;a=blobdiff_plain;f=BookReader%2FBookReader.js;fp=BookReader%2FBookReader.js;h=36379a126d77b251fcde88a8f45dc2c324022ef4;hp=e2e1de7eaedc065da8f5c41e8e83dedf3f7d0488;hb=32dcce1c6c33c22670b8c651356595c6a8c2a0ad;hpb=2f18c355b86fad952ddbecc2c623823405cec310 diff --git a/BookReader/BookReader.js b/BookReader/BookReader.js index e2e1de7..36379a1 100644 --- a/BookReader/BookReader.js +++ b/BookReader/BookReader.js @@ -47,7 +47,7 @@ function BookReader() { this.mode = this.constMode1up; this.ui = 'full'; // UI mode - this.uiAutoHide = true; // Controls whether nav/toolbar will autohide + this.uiAutoHide = false; // Controls whether nav/toolbar will autohide // thumbnail mode this.thumbWidth = 100; // will be overridden during prepareThumbnailView @@ -82,7 +82,7 @@ function BookReader() { // We link to index.php to avoid redirect which breaks back button // Should be overriden (before init) by custom implmentations. - this.logoURL = 'http://www.archive.org/index.php'; + this.logoURL = 'http://openlibrary.org'; // Base URL for UI images - should be overriden (before init) by // custom implementations. @@ -184,10 +184,7 @@ BookReader.prototype.init = function() { $("#BookReader").append("
"); $("#BRcontainer").append(""); - - this.initNavbar(); - this.bindNavigationHandlers(); - + // Autohide nav after showing for awhile var self = this; if (this.uiAutoHide) { @@ -271,6 +268,11 @@ BookReader.prototype.init = function() { // Enact other parts of initial params this.updateFromParams(params); + + // We init the nav bar after the params processing so that the nav slider knows where + // it should start (doesn't jump after init) + this.initNavbar(); + this.bindNavigationHandlers(); // Start AJAX request for OL data if (this.getOpenLibraryRecord) { @@ -362,7 +364,6 @@ BookReader.prototype.bindGestures = function(jElement) { br.zoom(-1); } }); - } BookReader.prototype.setClickHandler2UP = function( element, data, handler) { @@ -1207,6 +1208,8 @@ BookReader.prototype.jumpToPage = function(pageNum) { //______________________________________________________________________________ BookReader.prototype.jumpToIndex = function(index, pageX, pageY) { + this.updateNavIndex(index); + if (this.constMode2up == this.mode) { this.autoStop(); @@ -2029,6 +2032,8 @@ BookReader.prototype.flipBackToIndex = function(index) { } //if (index<0) return; + this.updateNavIndex(index); + var previousIndices = this.getSpreadIndices(index); if (previousIndices[0] < this.firstDisplayableIndex() || previousIndices[1] < this.firstDisplayableIndex()) { @@ -2201,7 +2206,7 @@ BookReader.prototype.flipLeftToRight = function(newIndexL, newIndexR) { BookReader.prototype.flipFwdToIndex = function(index) { if (this.animating) return; - + if (null != this.leafEdgeTmp) { alert('error: leafEdgeTmp should be null!'); return; @@ -2212,6 +2217,8 @@ BookReader.prototype.flipFwdToIndex = function(index) { } if (index > this.lastDisplayableIndex()) return; + this.updateNavIndex(index); + this.animating = true; var nextIndices = this.getSpreadIndices(index); @@ -3235,14 +3242,7 @@ BookReader.prototype.initNavbar = function() { + '' + '