perfect-gui 3.0.4 → 3.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 +11 -4
- package/test/src/js/folders.js +4 -0
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -10,6 +10,8 @@ export default class GUI {
|
|
|
10
10
|
this.position_type = 'fixed';
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
this.propReferences = [];
|
|
14
|
+
|
|
13
15
|
if ( options.isFolder ) {
|
|
14
16
|
this._folderConstructor(options.folderOptions);
|
|
15
17
|
return;
|
|
@@ -77,8 +79,6 @@ export default class GUI {
|
|
|
77
79
|
if (options.closed) this.toggleClose();
|
|
78
80
|
|
|
79
81
|
this.folders = [];
|
|
80
|
-
|
|
81
|
-
this.propReferences = [];
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
_folderConstructor(folderOptions) {
|
|
@@ -478,8 +478,15 @@ export default class GUI {
|
|
|
478
478
|
this.imageContainer = null;
|
|
479
479
|
|
|
480
480
|
let className = 'p-gui__folder';
|
|
481
|
-
|
|
482
|
-
if (
|
|
481
|
+
|
|
482
|
+
if (this.folders.length == 0) {
|
|
483
|
+
className += ' p-gui__folder--first';
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
if (closed) {
|
|
487
|
+
className += ' p-gui__folder--closed';
|
|
488
|
+
}
|
|
489
|
+
|
|
483
490
|
let container = this._createElement({
|
|
484
491
|
class: className
|
|
485
492
|
});
|
package/test/src/js/folders.js
CHANGED
|
@@ -15,6 +15,10 @@ export default function folders() {
|
|
|
15
15
|
element.style.backgroundColor = getRandomColor();
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
+
folder_1.slider("Size", { value: 1 }, value => {
|
|
19
|
+
element.style.transform = `scale(${value})`;
|
|
20
|
+
});
|
|
21
|
+
|
|
18
22
|
let folder_2 = gui.folder('Folder 2 (closed)', { closed: true });
|
|
19
23
|
|
|
20
24
|
folder_2.button("Random color", () => {
|