Skip to content

Commit

Permalink
add a way to remove a folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Sigill authored and donmccurdy committed Dec 23, 2017
1 parent 05c85ec commit 60033b6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/dat/gui/GUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,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();
});
},

/**
* Opens the GUI.
*/
Expand Down

0 comments on commit 60033b6

Please sign in to comment.