mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
make colWidth always even
This commit is contained in:
parent
06d1f95b67
commit
501b55e0bf
3 changed files with 15 additions and 9 deletions
|
@ -5,6 +5,8 @@ FP.app.init = (function($){
|
||||||
var Book;
|
var Book;
|
||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
|
FP.core.crossBrowserColumnCss();
|
||||||
|
|
||||||
Book = new FP.Book("area", "/moby-dick/");
|
Book = new FP.Book("area", "/moby-dick/");
|
||||||
//Book = new FP.Book("area", "/the-hound-of-the-baskervilles/");
|
//Book = new FP.Book("area", "/the-hound-of-the-baskervilles/");
|
||||||
|
|
||||||
|
@ -15,7 +17,7 @@ FP.app.init = (function($){
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
meta();
|
meta();
|
||||||
toc();
|
toc();
|
||||||
}, 100);
|
}, 500);
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
toc();
|
toc();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
|
@ -267,6 +267,12 @@ FP.Book.prototype.formatSpread = function(end){
|
||||||
this.gap = this.gap || this.elWidth / 8;
|
this.gap = this.gap || this.elWidth / 8;
|
||||||
|
|
||||||
this.colWidth = Math.ceil((this.elWidth - this.gap) / 2);
|
this.colWidth = Math.ceil((this.elWidth - this.gap) / 2);
|
||||||
|
|
||||||
|
//-- Must be even for firefox
|
||||||
|
if(this.colWidth % 2 != 0){
|
||||||
|
this.colWidth -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
this.spreadWidth = (this.colWidth + this.gap) * 2;
|
this.spreadWidth = (this.colWidth + this.gap) * 2;
|
||||||
|
|
||||||
//-- Clear Margins
|
//-- Clear Margins
|
||||||
|
@ -341,7 +347,6 @@ FP.Book.prototype.chapterEnd = function(){
|
||||||
}
|
}
|
||||||
|
|
||||||
FP.Book.prototype.getTOC = function(){
|
FP.Book.prototype.getTOC = function(){
|
||||||
console.log(this.toc)
|
|
||||||
return this.toc;
|
return this.toc;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,9 +58,8 @@ FP.core.crossBrowserColumnCss = function(){
|
||||||
FP.core.columnWidth = Modernizr.prefixed('columnWidth') || 'columnWidth';
|
FP.core.columnWidth = Modernizr.prefixed('columnWidth') || 'columnWidth';
|
||||||
|
|
||||||
// we are interested in the css prefixed version
|
// we are interested in the css prefixed version
|
||||||
FP.core.columnAxis = cssIfy(FP.core.columnAxis);
|
// FP.core.columnAxis = cssIfy(FP.core.columnAxis);
|
||||||
FP.core.columnGap = cssIfy(FP.core.columnGap);
|
// FP.core.columnGap = cssIfy(FP.core.columnGap);
|
||||||
FP.core.columnWidth = cssIfy(FP.core.columnWidth);
|
// FP.core.columnWidth = cssIfy(FP.core.columnWidth);
|
||||||
}
|
|
||||||
|
|
||||||
FP.core.crossBrowserColumnCss();
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue