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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +13 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perfect-gui",
3
- "version": "4.0.4",
3
+ "version": "4.0.5",
4
4
  "description": "Nice and simple GUI for JavaScript",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
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
- this.maxHeight = Math.min(this.container.clientHeight, window.innerHeight)
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
- this.maxHeight = Math.min(this.initMaxHeight, Math.min(this.container.clientHeight, window.innerHeight));
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;