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:
parent
66515b2e9c
commit
053ddb23a5
2 changed files with 6 additions and 2 deletions
|
@ -466,10 +466,13 @@ FP.Book.prototype.chapterTitle = function(){
|
||||||
|
|
||||||
FP.Book.prototype.startDisplay = function(chapter){
|
FP.Book.prototype.startDisplay = function(chapter){
|
||||||
var routed,
|
var routed,
|
||||||
|
prevChapter = this.spinePos,
|
||||||
loaded = function(chapter){
|
loaded = function(chapter){
|
||||||
|
|
||||||
//-- If there is a saved page, and the pages haven't changed go to it
|
//-- 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);
|
chapter.page(this.prevChapterPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,8 @@ FP.Chapter = function(book, pos){
|
||||||
this.book = book;
|
this.book = book;
|
||||||
this.iframe = this.book.iframe;
|
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
|
//-- Get the url to the book from the spine
|
||||||
this.path = this.chapInfo.href;
|
this.path = this.chapInfo.href;
|
||||||
this.ID = this.chapInfo.id;
|
this.ID = this.chapInfo.id;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue