Skip to content

Commit

Permalink
Merge pull request #33 from d-i-t-a/fixes/next-previous
Browse files Browse the repository at this point in the history
fixed next/previous page
  • Loading branch information
aferditamuriqi authored May 15, 2020
2 parents a143184 + 1c8ec88 commit 74d0ce7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 34 deletions.
43 changes: 12 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@d-i-t-a/reader",
"version": "1.1.1",
"version": "1.1.2",
"description": "A viewer application for EPUB files.",
"repository": "https://github.com/d-i-t-a/R2D2BC",
"main": "src/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/navigator/IFrameNavigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ export default class IFrameNavigator implements Navigator {
const position: Locator = {
href: this.publication.getAbsoluteHref(this.previousChapterLink.href),
locations: {
progression: 0
progression: 1
},
type: this.previousChapterLink.type,
title: this.previousChapterLink.title
Expand Down
2 changes: 1 addition & 1 deletion src/views/ScrollingBookView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default class ScrollingBookView implements ContinuousBookView {
}

public atBottom(): boolean {
return (document.scrollingElement.scrollHeight - document.scrollingElement.scrollTop) === BrowserUtilities.getHeight();
return (Math.ceil(document.scrollingElement.scrollHeight - document.scrollingElement.scrollTop) - 1) <= BrowserUtilities.getHeight();
}

public atTop(): boolean {
Expand Down

0 comments on commit 74d0ce7

Please sign in to comment.