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

Changed iframe height and width to use original settings

This commit is contained in:
Fred Chasen 2016-09-02 11:47:36 +02:00
parent d8de993c94
commit 8e66bdc57e
5 changed files with 17 additions and 9 deletions

View file

@ -5821,9 +5821,9 @@ EPUBJS.Render.Iframe.prototype.addIframe = function(){
this.iframe.addEventListener("load", this.loaded.bind(this), false);
if (this.width || this.height) {
this.iframe.height = this.height;
this.iframe.width = this.width;
if (this._width || this._height) {
this.iframe.height = this._height;
this.iframe.width = this._width;
}
return this.iframe;
};
@ -5934,6 +5934,10 @@ EPUBJS.Render.Iframe.prototype.resize = function(width, height){
this.iframe.width = width;
}
// Set the width for the iframe
this._height = height;
this._width = width;
// Get the fractional height and width of the iframe
// Default to orginal if bounding rect is 0
this.width = this.element.getBoundingClientRect().width || width;

File diff suppressed because one or more lines are too long

2
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

@ -31,9 +31,9 @@ EPUBJS.Render.Iframe.prototype.addIframe = function(){
this.iframe.addEventListener("load", this.loaded.bind(this), false);
if (this.width || this.height) {
this.iframe.height = this.height;
this.iframe.width = this.width;
if (this._width || this._height) {
this.iframe.height = this._height;
this.iframe.width = this._width;
}
return this.iframe;
};
@ -144,6 +144,10 @@ EPUBJS.Render.Iframe.prototype.resize = function(width, height){
this.iframe.width = width;
}
// Set the width for the iframe
this._height = height;
this._width = width;
// Get the fractional height and width of the iframe
// Default to orginal if bounding rect is 0
this.width = this.element.getBoundingClientRect().width || width;