perfect-gui 4.0.4 → 4.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +13 -2
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -22,7 +22,11 @@ export default class GUI {
|
|
|
22
22
|
|
|
23
23
|
this.backgroundColor = options.color || null;
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
if (this.container == document.body) {
|
|
26
|
+
this.maxHeight = window.innerHeight;
|
|
27
|
+
} else {
|
|
28
|
+
this.maxHeight = Math.min(this.container.clientHeight, window.innerHeight)
|
|
29
|
+
}
|
|
26
30
|
if ( options.maxHeight ) {
|
|
27
31
|
this.initMaxHeight = options.maxHeight;
|
|
28
32
|
this.maxHeight = Math.min(this.initMaxHeight, this.maxHeight);
|
|
@@ -135,7 +139,14 @@ export default class GUI {
|
|
|
135
139
|
}
|
|
136
140
|
|
|
137
141
|
_handleResize() {
|
|
138
|
-
|
|
142
|
+
if (this.container == document.body) {
|
|
143
|
+
this.maxHeight = window.innerHeight;
|
|
144
|
+
} else {
|
|
145
|
+
this.maxHeight = Math.min(this.container.clientHeight, window.innerHeight)
|
|
146
|
+
}
|
|
147
|
+
if (this.initMaxHeight) {
|
|
148
|
+
this.maxHeight = Math.min(this.initMaxHeight, this.maxHeight);
|
|
149
|
+
}
|
|
139
150
|
|
|
140
151
|
if (this.hasBeenDragged) {
|
|
141
152
|
return;
|