diff --git a/src/dat/gui/GUI.js b/src/dat/gui/GUI.js index e0ee00b..4c00993 100644 --- a/src/dat/gui/GUI.js +++ b/src/dat/gui/GUI.js @@ -628,6 +628,29 @@ common.extend( return gui; }, + /** + * Removes a subfolder GUI instance. + * {dat.gui.GUI} folder The folder to remove. + * @instance + */ + removeFolder: function(folder) { + this.__ul.removeChild(folder.domElement.parentElement); + + delete this.__folders[folder.name]; + + // Do we have saved appearance data for this folder? + if (this.load && // Anything loaded? + this.load.folders && // Was my parent a dead-end? + this.load.folders[folder.name]) { + delete this.load.folders[folder.name]; + } + + const _this = this; + common.defer(function() { + _this.onResize(); + }); + }, + /** * Opens the GUI. */ diff --git a/tests/index.html b/tests/index.html index c5b13ca..6b146c0 100644 --- a/tests/index.html +++ b/tests/index.html @@ -6,7 +6,7 @@ - + - +
@@ -1433,4 +1447,4 @@ console.log(c2.__checkbox.getAttribute('checked'));