1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-04 15:09:16 +02:00

updated gap settings, resize

This commit is contained in:
fchasen 2014-05-04 09:31:47 -07:00
parent 2e5797a24f
commit 6dc9088fb7
11 changed files with 167 additions and 71 deletions

View file

@ -2266,7 +2266,7 @@ EPUBJS.Book = function(options){
layoutOveride : null, // Default: { spread: 'reflowable', layout: 'auto', orientation: 'auto'} layoutOveride : null, // Default: { spread: 'reflowable', layout: 'auto', orientation: 'auto'}
orientation : null, orientation : null,
minSpreadWidth: 800, //-- overridden by spread: none (never) / both (always) minSpreadWidth: 800, //-- overridden by spread: none (never) / both (always)
gap: false, //-- False == auto gap: "auto", //-- "auto" or int
version: 1, version: 1,
restore: false, restore: false,
reload : false, reload : false,
@ -2631,7 +2631,7 @@ EPUBJS.Book.prototype.generatePageList = function(width, height){
}); });
if(pager.pageMap.length % 2 > 0 && if(pager.pageMap.length % 2 > 0 &&
pager.layoutMethod == "ReflowableSpreads") { pager.spreads) {
currentPage += 1; // Handle Spreads currentPage += 1; // Handle Spreads
pageList.push({ pageList.push({
"cfi" : pager.pageMap[pager.pageMap.length - 1].end, "cfi" : pager.pageMap[pager.pageMap.length - 1].end,
@ -3345,7 +3345,7 @@ EPUBJS.Book.prototype.forceSingle = function(use) {
} }
}; };
EPUBJS.Book.prototype.setSpreadWidth = function(width) { EPUBJS.Book.prototype.setMinSpreadWidth = function(width) {
this.settings.minSpreadWidth = width; this.settings.minSpreadWidth = width;
if(this.isRendered) { if(this.isRendered) {
this.renderer.setMinSpreadWidth(this.settings.minSpreadWidth); this.renderer.setMinSpreadWidth(this.settings.minSpreadWidth);
@ -4762,7 +4762,7 @@ EPUBJS.Layout.Reflowable.prototype.format = function(documentElement, _width, _h
var width = Math.floor(_width); var width = Math.floor(_width);
// var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 0; // Not needed for single // var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 0; // Not needed for single
var section = Math.floor(width / 8); var section = Math.floor(width / 8);
var gap = _gap || (section % 2 === 0) ? section : section - 1; var gap = (_gap >= 0) ? _gap : ((section % 2 === 0) ? section : section - 1);
this.documentElement = documentElement; this.documentElement = documentElement;
//-- Single Page //-- Single Page
this.spreadWidth = (width + gap); this.spreadWidth = (width + gap);
@ -4819,7 +4819,8 @@ EPUBJS.Layout.ReflowableSpreads.prototype.format = function(documentElement, _wi
var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 1; var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 1;
var section = Math.floor(width / 8); var section = Math.floor(width / 8);
var gap = _gap || (section % 2 === 0) ? section : section - 1; var gap = (_gap >= 0) ? _gap : ((section % 2 === 0) ? section : section - 1);
//-- Double Page //-- Double Page
var colWidth = Math.floor((width - gap) / divisor); var colWidth = Math.floor((width - gap) / divisor);
@ -6373,7 +6374,7 @@ EPUBJS.Renderer.prototype.getPageCfi = function(prevEl){
// Get the cfi of the current page // Get the cfi of the current page
EPUBJS.Renderer.prototype.getPageCfi = function(){ EPUBJS.Renderer.prototype.getPageCfi = function(){
var pg; var pg;
if (this.layoutMethod == "ReflowableSpreads") { if (this.spreads) {
pg = this.chapterPos*2; pg = this.chapterPos*2;
startRange = this.pageMap[pg-2]; startRange = this.pageMap[pg-2];
} else { } else {
@ -6427,10 +6428,16 @@ EPUBJS.Renderer.prototype.getVisibleRangeCfi = function(prevEl){
}; };
*/ */
EPUBJS.Renderer.prototype.getVisibleRangeCfi = function(prevEl){ EPUBJS.Renderer.prototype.getVisibleRangeCfi = function(){
var pg; var pg;
var startRange, endRange; var startRange, endRange;
if (this.layoutMethod == "ReflowableSpreads") {
if(!this.pageMap) {
console.warn("page map not loaded");
return false;
}
if (this.spreads) {
pg = this.chapterPos*2; pg = this.chapterPos*2;
startRange = this.pageMap[pg-2]; startRange = this.pageMap[pg-2];
endRange = startRange; endRange = startRange;
@ -6443,6 +6450,13 @@ EPUBJS.Renderer.prototype.getVisibleRangeCfi = function(prevEl){
startRange = this.pageMap[pg-1]; startRange = this.pageMap[pg-1];
endRange = startRange; endRange = startRange;
} }
if(!startRange) {
console.warn("startRange miss:", this.pageMap, pg);
startRange = this.pageMap[this.pageMap.length-1];
endRange = startRange;
}
return { return {
start: startRange.start, start: startRange.start,
end: endRange.end end: endRange.end
@ -6519,13 +6533,15 @@ EPUBJS.Renderer.prototype.hideHashChanges = function(){
*/ */
//-- Listeners for events in the frame EPUBJS.Renderer.prototype.resize = function(width, height, setSize){
EPUBJS.Renderer.prototype.onResized = function(e){
var spreads; var spreads;
this.width = this.container.clientWidth; this.width = width;
this.height = this.container.clientHeight; this.height = height;
if(setSize !== false) {
this.render.resize(this.width, this.height);
}
spreads = this.determineSpreads(this.minSpreadWidth); spreads = this.determineSpreads(this.minSpreadWidth);
// Only re-layout if the spreads have switched // Only re-layout if the spreads have switched
@ -6543,7 +6559,15 @@ EPUBJS.Renderer.prototype.onResized = function(e){
width: this.width, width: this.width,
height: this.height height: this.height
}); });
};
//-- Listeners for events in the frame
EPUBJS.Renderer.prototype.onResized = function(e) {
var width = this.container.clientWidth;
var height = this.container.clientHeight;
this.resize(width, height, false);
}; };
EPUBJS.Renderer.prototype.addEventListeners = function(){ EPUBJS.Renderer.prototype.addEventListeners = function(){

File diff suppressed because one or more lines are too long

6
build/epub.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -2265,7 +2265,7 @@ EPUBJS.Book = function(options){
layoutOveride : null, // Default: { spread: 'reflowable', layout: 'auto', orientation: 'auto'} layoutOveride : null, // Default: { spread: 'reflowable', layout: 'auto', orientation: 'auto'}
orientation : null, orientation : null,
minSpreadWidth: 800, //-- overridden by spread: none (never) / both (always) minSpreadWidth: 800, //-- overridden by spread: none (never) / both (always)
gap: false, //-- False == auto gap: "auto", //-- "auto" or int
version: 1, version: 1,
restore: false, restore: false,
reload : false, reload : false,
@ -2630,7 +2630,7 @@ EPUBJS.Book.prototype.generatePageList = function(width, height){
}); });
if(pager.pageMap.length % 2 > 0 && if(pager.pageMap.length % 2 > 0 &&
pager.layoutMethod == "ReflowableSpreads") { pager.spreads) {
currentPage += 1; // Handle Spreads currentPage += 1; // Handle Spreads
pageList.push({ pageList.push({
"cfi" : pager.pageMap[pager.pageMap.length - 1].end, "cfi" : pager.pageMap[pager.pageMap.length - 1].end,
@ -3344,7 +3344,7 @@ EPUBJS.Book.prototype.forceSingle = function(use) {
} }
}; };
EPUBJS.Book.prototype.setSpreadWidth = function(width) { EPUBJS.Book.prototype.setMinSpreadWidth = function(width) {
this.settings.minSpreadWidth = width; this.settings.minSpreadWidth = width;
if(this.isRendered) { if(this.isRendered) {
this.renderer.setMinSpreadWidth(this.settings.minSpreadWidth); this.renderer.setMinSpreadWidth(this.settings.minSpreadWidth);
@ -4761,7 +4761,7 @@ EPUBJS.Layout.Reflowable.prototype.format = function(documentElement, _width, _h
var width = Math.floor(_width); var width = Math.floor(_width);
// var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 0; // Not needed for single // var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 0; // Not needed for single
var section = Math.floor(width / 8); var section = Math.floor(width / 8);
var gap = _gap || (section % 2 === 0) ? section : section - 1; var gap = (_gap >= 0) ? _gap : ((section % 2 === 0) ? section : section - 1);
this.documentElement = documentElement; this.documentElement = documentElement;
//-- Single Page //-- Single Page
this.spreadWidth = (width + gap); this.spreadWidth = (width + gap);
@ -4818,7 +4818,8 @@ EPUBJS.Layout.ReflowableSpreads.prototype.format = function(documentElement, _wi
var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 1; var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 1;
var section = Math.floor(width / 8); var section = Math.floor(width / 8);
var gap = _gap || (section % 2 === 0) ? section : section - 1; var gap = (_gap >= 0) ? _gap : ((section % 2 === 0) ? section : section - 1);
//-- Double Page //-- Double Page
var colWidth = Math.floor((width - gap) / divisor); var colWidth = Math.floor((width - gap) / divisor);
@ -6372,7 +6373,7 @@ EPUBJS.Renderer.prototype.getPageCfi = function(prevEl){
// Get the cfi of the current page // Get the cfi of the current page
EPUBJS.Renderer.prototype.getPageCfi = function(){ EPUBJS.Renderer.prototype.getPageCfi = function(){
var pg; var pg;
if (this.layoutMethod == "ReflowableSpreads") { if (this.spreads) {
pg = this.chapterPos*2; pg = this.chapterPos*2;
startRange = this.pageMap[pg-2]; startRange = this.pageMap[pg-2];
} else { } else {
@ -6426,10 +6427,16 @@ EPUBJS.Renderer.prototype.getVisibleRangeCfi = function(prevEl){
}; };
*/ */
EPUBJS.Renderer.prototype.getVisibleRangeCfi = function(prevEl){ EPUBJS.Renderer.prototype.getVisibleRangeCfi = function(){
var pg; var pg;
var startRange, endRange; var startRange, endRange;
if (this.layoutMethod == "ReflowableSpreads") {
if(!this.pageMap) {
console.warn("page map not loaded");
return false;
}
if (this.spreads) {
pg = this.chapterPos*2; pg = this.chapterPos*2;
startRange = this.pageMap[pg-2]; startRange = this.pageMap[pg-2];
endRange = startRange; endRange = startRange;
@ -6442,6 +6449,13 @@ EPUBJS.Renderer.prototype.getVisibleRangeCfi = function(prevEl){
startRange = this.pageMap[pg-1]; startRange = this.pageMap[pg-1];
endRange = startRange; endRange = startRange;
} }
if(!startRange) {
console.warn("startRange miss:", this.pageMap, pg);
startRange = this.pageMap[this.pageMap.length-1];
endRange = startRange;
}
return { return {
start: startRange.start, start: startRange.start,
end: endRange.end end: endRange.end
@ -6518,13 +6532,15 @@ EPUBJS.Renderer.prototype.hideHashChanges = function(){
*/ */
//-- Listeners for events in the frame EPUBJS.Renderer.prototype.resize = function(width, height, setSize){
EPUBJS.Renderer.prototype.onResized = function(e){
var spreads; var spreads;
this.width = this.container.clientWidth; this.width = width;
this.height = this.container.clientHeight; this.height = height;
if(setSize !== false) {
this.render.resize(this.width, this.height);
}
spreads = this.determineSpreads(this.minSpreadWidth); spreads = this.determineSpreads(this.minSpreadWidth);
// Only re-layout if the spreads have switched // Only re-layout if the spreads have switched
@ -6542,7 +6558,15 @@ EPUBJS.Renderer.prototype.onResized = function(e){
width: this.width, width: this.width,
height: this.height height: this.height
}); });
};
//-- Listeners for events in the frame
EPUBJS.Renderer.prototype.onResized = function(e) {
var width = this.container.clientWidth;
var height = this.container.clientHeight;
this.resize(width, height, false);
}; };
EPUBJS.Renderer.prototype.addEventListeners = function(){ EPUBJS.Renderer.prototype.addEventListeners = function(){

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

50
reader/js/epub.min.js vendored
View file

@ -2266,7 +2266,7 @@ EPUBJS.Book = function(options){
layoutOveride : null, // Default: { spread: 'reflowable', layout: 'auto', orientation: 'auto'} layoutOveride : null, // Default: { spread: 'reflowable', layout: 'auto', orientation: 'auto'}
orientation : null, orientation : null,
minSpreadWidth: 800, //-- overridden by spread: none (never) / both (always) minSpreadWidth: 800, //-- overridden by spread: none (never) / both (always)
gap: false, //-- False == auto gap: "auto", //-- "auto" or int
version: 1, version: 1,
restore: false, restore: false,
reload : false, reload : false,
@ -2631,7 +2631,7 @@ EPUBJS.Book.prototype.generatePageList = function(width, height){
}); });
if(pager.pageMap.length % 2 > 0 && if(pager.pageMap.length % 2 > 0 &&
pager.layoutMethod == "ReflowableSpreads") { pager.spreads) {
currentPage += 1; // Handle Spreads currentPage += 1; // Handle Spreads
pageList.push({ pageList.push({
"cfi" : pager.pageMap[pager.pageMap.length - 1].end, "cfi" : pager.pageMap[pager.pageMap.length - 1].end,
@ -3345,7 +3345,7 @@ EPUBJS.Book.prototype.forceSingle = function(use) {
} }
}; };
EPUBJS.Book.prototype.setSpreadWidth = function(width) { EPUBJS.Book.prototype.setMinSpreadWidth = function(width) {
this.settings.minSpreadWidth = width; this.settings.minSpreadWidth = width;
if(this.isRendered) { if(this.isRendered) {
this.renderer.setMinSpreadWidth(this.settings.minSpreadWidth); this.renderer.setMinSpreadWidth(this.settings.minSpreadWidth);
@ -4762,7 +4762,7 @@ EPUBJS.Layout.Reflowable.prototype.format = function(documentElement, _width, _h
var width = Math.floor(_width); var width = Math.floor(_width);
// var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 0; // Not needed for single // var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 0; // Not needed for single
var section = Math.floor(width / 8); var section = Math.floor(width / 8);
var gap = _gap || (section % 2 === 0) ? section : section - 1; var gap = (_gap >= 0) ? _gap : ((section % 2 === 0) ? section : section - 1);
this.documentElement = documentElement; this.documentElement = documentElement;
//-- Single Page //-- Single Page
this.spreadWidth = (width + gap); this.spreadWidth = (width + gap);
@ -4819,7 +4819,8 @@ EPUBJS.Layout.ReflowableSpreads.prototype.format = function(documentElement, _wi
var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 1; var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 1;
var section = Math.floor(width / 8); var section = Math.floor(width / 8);
var gap = _gap || (section % 2 === 0) ? section : section - 1; var gap = (_gap >= 0) ? _gap : ((section % 2 === 0) ? section : section - 1);
//-- Double Page //-- Double Page
var colWidth = Math.floor((width - gap) / divisor); var colWidth = Math.floor((width - gap) / divisor);
@ -6373,7 +6374,7 @@ EPUBJS.Renderer.prototype.getPageCfi = function(prevEl){
// Get the cfi of the current page // Get the cfi of the current page
EPUBJS.Renderer.prototype.getPageCfi = function(){ EPUBJS.Renderer.prototype.getPageCfi = function(){
var pg; var pg;
if (this.layoutMethod == "ReflowableSpreads") { if (this.spreads) {
pg = this.chapterPos*2; pg = this.chapterPos*2;
startRange = this.pageMap[pg-2]; startRange = this.pageMap[pg-2];
} else { } else {
@ -6427,10 +6428,16 @@ EPUBJS.Renderer.prototype.getVisibleRangeCfi = function(prevEl){
}; };
*/ */
EPUBJS.Renderer.prototype.getVisibleRangeCfi = function(prevEl){ EPUBJS.Renderer.prototype.getVisibleRangeCfi = function(){
var pg; var pg;
var startRange, endRange; var startRange, endRange;
if (this.layoutMethod == "ReflowableSpreads") {
if(!this.pageMap) {
console.warn("page map not loaded");
return false;
}
if (this.spreads) {
pg = this.chapterPos*2; pg = this.chapterPos*2;
startRange = this.pageMap[pg-2]; startRange = this.pageMap[pg-2];
endRange = startRange; endRange = startRange;
@ -6443,6 +6450,13 @@ EPUBJS.Renderer.prototype.getVisibleRangeCfi = function(prevEl){
startRange = this.pageMap[pg-1]; startRange = this.pageMap[pg-1];
endRange = startRange; endRange = startRange;
} }
if(!startRange) {
console.warn("startRange miss:", this.pageMap, pg);
startRange = this.pageMap[this.pageMap.length-1];
endRange = startRange;
}
return { return {
start: startRange.start, start: startRange.start,
end: endRange.end end: endRange.end
@ -6519,13 +6533,15 @@ EPUBJS.Renderer.prototype.hideHashChanges = function(){
*/ */
//-- Listeners for events in the frame EPUBJS.Renderer.prototype.resize = function(width, height, setSize){
EPUBJS.Renderer.prototype.onResized = function(e){
var spreads; var spreads;
this.width = this.container.clientWidth; this.width = width;
this.height = this.container.clientHeight; this.height = height;
if(setSize !== false) {
this.render.resize(this.width, this.height);
}
spreads = this.determineSpreads(this.minSpreadWidth); spreads = this.determineSpreads(this.minSpreadWidth);
// Only re-layout if the spreads have switched // Only re-layout if the spreads have switched
@ -6543,7 +6559,15 @@ EPUBJS.Renderer.prototype.onResized = function(e){
width: this.width, width: this.width,
height: this.height height: this.height
}); });
};
//-- Listeners for events in the frame
EPUBJS.Renderer.prototype.onResized = function(e) {
var width = this.container.clientWidth;
var height = this.container.clientHeight;
this.resize(width, height, false);
}; };
EPUBJS.Renderer.prototype.addEventListeners = function(){ EPUBJS.Renderer.prototype.addEventListeners = function(){

View file

@ -16,7 +16,7 @@ EPUBJS.Book = function(options){
layoutOveride : null, // Default: { spread: 'reflowable', layout: 'auto', orientation: 'auto'} layoutOveride : null, // Default: { spread: 'reflowable', layout: 'auto', orientation: 'auto'}
orientation : null, orientation : null,
minSpreadWidth: 800, //-- overridden by spread: none (never) / both (always) minSpreadWidth: 800, //-- overridden by spread: none (never) / both (always)
gap: false, //-- False == auto gap: "auto", //-- "auto" or int
version: 1, version: 1,
restore: false, restore: false,
reload : false, reload : false,
@ -381,7 +381,7 @@ EPUBJS.Book.prototype.generatePageList = function(width, height){
}); });
if(pager.pageMap.length % 2 > 0 && if(pager.pageMap.length % 2 > 0 &&
pager.layoutMethod == "ReflowableSpreads") { pager.spreads) {
currentPage += 1; // Handle Spreads currentPage += 1; // Handle Spreads
pageList.push({ pageList.push({
"cfi" : pager.pageMap[pager.pageMap.length - 1].end, "cfi" : pager.pageMap[pager.pageMap.length - 1].end,
@ -1095,7 +1095,7 @@ EPUBJS.Book.prototype.forceSingle = function(use) {
} }
}; };
EPUBJS.Book.prototype.setSpreadWidth = function(width) { EPUBJS.Book.prototype.setMinSpreadWidth = function(width) {
this.settings.minSpreadWidth = width; this.settings.minSpreadWidth = width;
if(this.isRendered) { if(this.isRendered) {
this.renderer.setMinSpreadWidth(this.settings.minSpreadWidth); this.renderer.setMinSpreadWidth(this.settings.minSpreadWidth);

View file

@ -15,7 +15,7 @@ EPUBJS.Layout.Reflowable.prototype.format = function(documentElement, _width, _h
var width = Math.floor(_width); var width = Math.floor(_width);
// var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 0; // Not needed for single // var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 0; // Not needed for single
var section = Math.floor(width / 8); var section = Math.floor(width / 8);
var gap = _gap || (section % 2 === 0) ? section : section - 1; var gap = (_gap >= 0) ? _gap : ((section % 2 === 0) ? section : section - 1);
this.documentElement = documentElement; this.documentElement = documentElement;
//-- Single Page //-- Single Page
this.spreadWidth = (width + gap); this.spreadWidth = (width + gap);
@ -72,7 +72,8 @@ EPUBJS.Layout.ReflowableSpreads.prototype.format = function(documentElement, _wi
var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 1; var width = (fullWidth % 2 === 0) ? fullWidth : fullWidth - 1;
var section = Math.floor(width / 8); var section = Math.floor(width / 8);
var gap = _gap || (section % 2 === 0) ? section : section - 1; var gap = (_gap >= 0) ? _gap : ((section % 2 === 0) ? section : section - 1);
//-- Double Page //-- Double Page
var colWidth = Math.floor((width - gap) / divisor); var colWidth = Math.floor((width - gap) / divisor);

View file

@ -698,7 +698,7 @@ EPUBJS.Renderer.prototype.getPageCfi = function(prevEl){
// Get the cfi of the current page // Get the cfi of the current page
EPUBJS.Renderer.prototype.getPageCfi = function(){ EPUBJS.Renderer.prototype.getPageCfi = function(){
var pg; var pg;
if (this.layoutMethod == "ReflowableSpreads") { if (this.spreads) {
pg = this.chapterPos*2; pg = this.chapterPos*2;
startRange = this.pageMap[pg-2]; startRange = this.pageMap[pg-2];
} else { } else {
@ -752,10 +752,16 @@ EPUBJS.Renderer.prototype.getVisibleRangeCfi = function(prevEl){
}; };
*/ */
EPUBJS.Renderer.prototype.getVisibleRangeCfi = function(prevEl){ EPUBJS.Renderer.prototype.getVisibleRangeCfi = function(){
var pg; var pg;
var startRange, endRange; var startRange, endRange;
if (this.layoutMethod == "ReflowableSpreads") {
if(!this.pageMap) {
console.warn("page map not loaded");
return false;
}
if (this.spreads) {
pg = this.chapterPos*2; pg = this.chapterPos*2;
startRange = this.pageMap[pg-2]; startRange = this.pageMap[pg-2];
endRange = startRange; endRange = startRange;
@ -768,6 +774,13 @@ EPUBJS.Renderer.prototype.getVisibleRangeCfi = function(prevEl){
startRange = this.pageMap[pg-1]; startRange = this.pageMap[pg-1];
endRange = startRange; endRange = startRange;
} }
if(!startRange) {
console.warn("startRange miss:", this.pageMap, pg);
startRange = this.pageMap[this.pageMap.length-1];
endRange = startRange;
}
return { return {
start: startRange.start, start: startRange.start,
end: endRange.end end: endRange.end
@ -844,13 +857,15 @@ EPUBJS.Renderer.prototype.hideHashChanges = function(){
*/ */
//-- Listeners for events in the frame EPUBJS.Renderer.prototype.resize = function(width, height, setSize){
EPUBJS.Renderer.prototype.onResized = function(e){
var spreads; var spreads;
this.width = this.container.clientWidth; this.width = width;
this.height = this.container.clientHeight; this.height = height;
if(setSize !== false) {
this.render.resize(this.width, this.height);
}
spreads = this.determineSpreads(this.minSpreadWidth); spreads = this.determineSpreads(this.minSpreadWidth);
// Only re-layout if the spreads have switched // Only re-layout if the spreads have switched
@ -868,7 +883,15 @@ EPUBJS.Renderer.prototype.onResized = function(e){
width: this.width, width: this.width,
height: this.height height: this.height
}); });
};
//-- Listeners for events in the frame
EPUBJS.Renderer.prototype.onResized = function(e) {
var width = this.container.clientWidth;
var height = this.container.clientHeight;
this.resize(width, height, false);
}; };
EPUBJS.Renderer.prototype.addEventListeners = function(){ EPUBJS.Renderer.prototype.addEventListeners = function(){