1
0
Fork 0
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:
Fred Chasen 2014-01-03 11:17:03 -08:00
commit be2c2d0d9b

View file

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