Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

Commit

Permalink
Disable page numbers on mobile devices to prevent slow page turns
Browse files Browse the repository at this point in the history
  • Loading branch information
pgaskin committed Jul 24, 2017
1 parent c706106 commit 8b4858c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions static/reader/epub/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,14 @@ ePubViewer.actions.loadBook = function (urlOrArrayBuffer) {
ePubViewer.functions.updateIndicators();
});

var w = 600;
var h = 800;
ePubViewer.state.book.generatePagination(w, h).then(function () {
ePubViewer.functions.updateIndicators();
});
var ismobile = ( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) );
if (!ismobile) {
var w = 600;
var h = 800;
ePubViewer.state.book.generatePagination(w, h).then(function () {
ePubViewer.functions.updateIndicators();
});
}

ePubViewer.state.book.on('renderer:locationChanged', function (locationCfi) {
ePubViewer.functions.updateIndicators();
Expand Down

0 comments on commit 8b4858c

Please sign in to comment.