1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00

Update Stage size to allow resizing

This commit is contained in:
Fred Chasen 2018-08-24 11:56:50 -07:00
parent c3b074e9cf
commit 8a07db29c0

View file

@ -162,6 +162,12 @@ class Stage {
width = Math.floor(bounds.width); width = Math.floor(bounds.width);
this.container.style.width = width + "px"; this.container.style.width = width + "px";
} }
} else {
if (isNumber(width)) {
this.container.style.width = width + "px";
} else {
this.container.style.width = width;
}
} }
if(height === null) { if(height === null) {
@ -169,9 +175,15 @@ class Stage {
if(bounds.height) { if(bounds.height) {
height = bounds.height; height = bounds.height;
this.container.style.height = bounds.height + "px"; this.container.style.height = height + "px";
} }
} else {
if (isNumber(height)) {
this.container.style.height = height + "px";
} else {
this.container.style.height = height;
}
} }
if(!isNumber(width)) { if(!isNumber(width)) {