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:
parent
1a817d4674
commit
e09f007e13
5 changed files with 2093 additions and 1464 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue