mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-05 15:32:55 +02:00
Merge pull request #79 from jkarkoszka/master
prevent to go on out of ranges page
This commit is contained in:
commit
be2c2d0d9b
1 changed files with 2 additions and 4 deletions
|
@ -583,16 +583,14 @@ EPUBJS.Book.prototype.prevPage = function() {
|
|||
};
|
||||
|
||||
EPUBJS.Book.prototype.nextChapter = function() {
|
||||
this.spinePos++;
|
||||
if(this.spinePos > this.spine.length) return;
|
||||
|
||||
this.spinePos++;
|
||||
return this.displayChapter(this.spinePos);
|
||||
};
|
||||
|
||||
EPUBJS.Book.prototype.prevChapter = function() {
|
||||
if(this.spinePos < 1) return;
|
||||
this.spinePos--;
|
||||
if(this.spinePos < 0) return;
|
||||
|
||||
return this.displayChapter(this.spinePos, true);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue