mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
Balance columns, prevent scroll past end of content
This commit is contained in:
parent
4e566dde12
commit
3e9f8a609a
5 changed files with 26 additions and 12 deletions
|
@ -18,7 +18,7 @@ EPUBJS.Layout.Reflowable.prototype.calculate = function(_width, _height, _gap, _
|
|||
var colWidth;
|
||||
var spreadWidth;
|
||||
var delta;
|
||||
|
||||
|
||||
//-- Double Page
|
||||
if(divisor > 1) {
|
||||
colWidth = Math.floor((width - gap) / divisor);
|
||||
|
@ -29,7 +29,7 @@ EPUBJS.Layout.Reflowable.prototype.calculate = function(_width, _height, _gap, _
|
|||
spreadWidth = colWidth * divisor;
|
||||
|
||||
delta = (colWidth + gap) * divisor;
|
||||
|
||||
|
||||
|
||||
|
||||
this.columnAxis = EPUBJS.core.prefixed('columnAxis');
|
||||
|
@ -64,7 +64,7 @@ EPUBJS.Layout.Reflowable.prototype.format = function(view){
|
|||
|
||||
//-- Add columns
|
||||
$body.style[this.columnAxis] = "horizontal";
|
||||
$body.style[this.columnFill] = "auto";
|
||||
$body.style[this.columnFill] = "balance";
|
||||
$body.style[this.columnGap] = this.gap+"px";
|
||||
$body.style[this.columnWidth] = this.column+"px";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue