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

view removal updates

This commit is contained in:
Fred Chasen 2014-11-17 19:22:37 -05:00
parent 1a817d4674
commit e09f007e13
5 changed files with 2093 additions and 1464 deletions

View file

@ -11,13 +11,18 @@ EPUBJS.View = function(section) {
// this.element.style.minHeight = "100px";
this.element.style.height = 0;
this.element.style.width = 0;
this.element.style.overflow = "hidden";
this.shown = false;
this.rendered = false;
};
EPUBJS.View.prototype.create = function(width, height) {
if(this.iframe) {
return this.iframe;
}
this.iframe = document.createElement('iframe');
this.iframe.id = this.id;
this.iframe.scrolling = "no";
@ -46,14 +51,14 @@ EPUBJS.View.prototype.resize = function(width, height) {
if(this.iframe) {
this.iframe.style.width = width + "px";
}
this.element.style.width = width + "px";
// this.element.style.width = width + "px";
}
if(height){
if(this.iframe) {
this.iframe.style.height = height + "px";
}
this.element.style.height = height + "px";
// this.element.style.height = height + "px";
}
if (!this.resizing) {
@ -232,6 +237,9 @@ EPUBJS.View.prototype.onShown = function() {
EPUBJS.View.prototype.show = function() {
// this.iframe.style.display = "block";
this.element.style.width = this.width + "px";
this.element.style.height = this.height + "px";
this.iframe.style.display = "inline-block";
this.iframe.style.visibility = "visible";
@ -259,5 +267,7 @@ EPUBJS.View.prototype.destroy = function() {
this.shown = false;
this.iframe = null;
}
this.element.style.height = 0;
this.element.style.width = 0;
};