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

Update epubcfi use xpath when available and generation fixes

This commit is contained in:
Fred Chasen 2014-04-09 10:54:01 -07:00
parent 08886428e2
commit adf0464cf6
10 changed files with 193 additions and 33 deletions

View file

@ -12,11 +12,10 @@ EPUBJS.Layout.Reflowable.prototype.format = function(documentElement, _width, _h
var columnWidth = EPUBJS.core.prefixed('columnWidth');
//-- Check the width and create even width columns
var fullWidth = Math.floor(_width);
var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 1;
var width = Math.floor(_width);
// var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 0; // Not needed for single
var section = Math.floor(width / 8);
var gap = (section % 2 === 0) ? section : section - 1;
this.documentElement = documentElement;
//-- Single Page
this.spreadWidth = (width + gap);
@ -32,8 +31,8 @@ EPUBJS.Layout.Reflowable.prototype.format = function(documentElement, _width, _h
//-- Add columns
documentElement.style[columnAxis] = "horizontal";
documentElement.style[columnGap] = gap+"px";
documentElement.style[columnWidth] = width+"px";
documentElement.style[columnGap] = gap+"px";
return {
pageWidth : this.spreadWidth,
@ -69,6 +68,7 @@ EPUBJS.Layout.ReflowableSpreads.prototype.format = function(documentElement, _wi
//-- Check the width and create even width columns
var fullWidth = Math.floor(_width);
var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 1;
var section = Math.floor(width / 8);
var gap = (section % 2 === 0) ? section : section - 1;
//-- Double Page