1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-03 14:59:18 +02:00

Add map for sections and pages, update queue to handle function without promise

This commit is contained in:
Fred Chasen 2015-05-26 19:59:06 -04:00
parent f998e5be0a
commit 5c33f9c52b
14 changed files with 1044 additions and 93 deletions

View file

@ -21,7 +21,9 @@ EPUBJS.Layout.Reflowable = function(_width, _height, _gap, _devisor){
colWidth = width;
}
spreadWidth = (colWidth + gap) * divisor;
spreadWidth = colWidth * divisor;
delta = (colWidth + gap) * divisor;
@ -33,6 +35,8 @@ EPUBJS.Layout.Reflowable = function(_width, _height, _gap, _devisor){
this.width = width;
this.height = _height;
this.spread = spreadWidth;
this.delta = delta;
this.column = colWidth;
this.gap = gap;
this.divisor = divisor;
@ -66,8 +70,8 @@ EPUBJS.Layout.Reflowable.prototype.format = function(view){
};
EPUBJS.Layout.Reflowable.prototype.count = function(view) {
var totalWidth = view.documentElement.scrollWidth;
var spreads = Math.ceil(totalWidth / this.spreadWidth);
var totalWidth = view.root().scrollWidth;
var spreads = Math.ceil(totalWidth / this.spread);
return {
spreads : spreads,
@ -117,8 +121,10 @@ EPUBJS.Layout.Fixed.prototype.count = function(){
};
};
EPUBJS.Layout.Scroll = function(){
EPUBJS.Layout.Scroll = function(_width, _height){
this.spread = _width;
this.column = _width;
this.gap = 0;
};
EPUBJS.Layout.Scroll.prototype.format = function(view){