diff --git a/fpjs/render/book.js b/fpjs/render/book.js index 488fc53..d9a11f0 100644 --- a/fpjs/render/book.js +++ b/fpjs/render/book.js @@ -466,10 +466,13 @@ FP.Book.prototype.chapterTitle = function(){ FP.Book.prototype.startDisplay = function(chapter){ var routed, + prevChapter = this.spinePos, loaded = function(chapter){ //-- If there is a saved page, and the pages haven't changed go to it - if(this.prevChapterPos && this.prevDisplayedPages == chapter.displayedPages){ + if( this.prevChapterPos + && prevChapter == chapter.pos + && this.prevDisplayedPages == chapter.displayedPages) { chapter.page(this.prevChapterPos); } diff --git a/fpjs/render/chapter.js b/fpjs/render/chapter.js index 4501932..1583f32 100644 --- a/fpjs/render/chapter.js +++ b/fpjs/render/chapter.js @@ -3,7 +3,8 @@ FP.Chapter = function(book, pos){ this.book = book; this.iframe = this.book.iframe; - this.chapInfo = this.book.spine[pos || this.book.spinePos]; + this.pos = pos || this.book.spinePos + this.chapInfo = this.book.spine[this.pos]; //-- Get the url to the book from the spine this.path = this.chapInfo.href; this.ID = this.chapInfo.id;