add a way to remove a folder

This commit is contained in:
Cyrille Faucheux 2016-10-12 22:05:26 +02:00 committed by Don McCurdy
parent 05c85ecf7d
commit 60033b6b1d

View File

@ -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.
*/