mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
split up layout functions into format and page calculate
This commit is contained in:
parent
0b6d852586
commit
c7b35c51fb
13 changed files with 317 additions and 219 deletions
|
@ -40,7 +40,7 @@ EPUBJS.Layout.Reflowable.prototype.format = function(documentElement, _width, _h
|
|||
};
|
||||
};
|
||||
|
||||
EPUBJS.Layout.Reflowable.prototype.calculatePages = function() {
|
||||
EPUBJS.Layout.Reflowable.prototype.calculatePages = function() {
|
||||
var totalWidth, displayedPages;
|
||||
this.documentElement.style.width = "auto"; //-- reset width for calculations
|
||||
totalWidth = this.documentElement.scrollWidth;
|
||||
|
@ -97,7 +97,7 @@ EPUBJS.Layout.ReflowableSpreads.prototype.format = function(documentElement, _wi
|
|||
};
|
||||
};
|
||||
|
||||
EPUBJS.Layout.ReflowableSpreads.prototype.calculatePages = function() {
|
||||
EPUBJS.Layout.ReflowableSpreads.prototype.calculatePages = function() {
|
||||
var totalWidth = this.documentElement.scrollWidth;
|
||||
var displayedPages = Math.round(totalWidth / this.spreadWidth);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue