From c83a0e3ddedfaf36830ff785ed79b92a848d05ae Mon Sep 17 00:00:00 2001 From: Cyrille Faucheux Date: Wed, 12 Oct 2016 22:05:26 +0200 Subject: [PATCH] add a way to remove a folder --- src/dat/gui/GUI.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/dat/gui/GUI.js b/src/dat/gui/GUI.js index dbb3e04..f0e9c0e 100644 --- a/src/dat/gui/GUI.js +++ b/src/dat/gui/GUI.js @@ -583,6 +583,24 @@ common.extend( return gui; }, + 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(); + }); + }, + open: function() { this.closed = false; },