From 3aaa59d225236ab562e3a630edd60ef105f18ba0 Mon Sep 17 00:00:00 2001 From: Shun Git Date: Mon, 9 Oct 2017 09:47:52 +0800 Subject: [PATCH] add removeFolder. From dataarts/dat.gui#143 --- src/dat/gui/GUI.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/dat/gui/GUI.js b/src/dat/gui/GUI.js index 803ee1b..c67797e 100644 --- a/src/dat/gui/GUI.js +++ b/src/dat/gui/GUI.js @@ -583,6 +583,20 @@ common.extend( return gui; }, + /** + * @param name + */ + removeFolder: function(name) { + var folder = this.__folders[name]; + if (!folder) { + return; + } + folder.close(); + this.__ul.removeChild(folder.domElement.parentNode); + delete this.__folders[name]; + this.onResize(); + }, + open: function() { this.closed = false; },