1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-03 14:59:18 +02:00

invalidate stored page position if chapter is different

This commit is contained in:
Fred Chasen 2013-01-27 19:17:54 -08:00
parent 66515b2e9c
commit 053ddb23a5
2 changed files with 6 additions and 2 deletions

View file

@ -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);
}

View file

@ -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;