mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
Merge pull request #19 from arahaya/enable_reset
added gui.reset() method
This commit is contained in:
commit
454b1535fe
@ -4,7 +4,8 @@ DAT.GUI.Controller = function() {
|
|||||||
this.object = arguments[1];
|
this.object = arguments[1];
|
||||||
this.propertyName = arguments[2];
|
this.propertyName = arguments[2];
|
||||||
|
|
||||||
if (arguments.length > 0) this.initialValue = this.propertyName[this.object];
|
//if (arguments.length > 0) this.initialValue = this.propertyName[this.object];
|
||||||
|
if (arguments.length > 0) this.initialValue = this.object[this.propertyName];
|
||||||
|
|
||||||
this.domElement = document.createElement('div');
|
this.domElement = document.createElement('div');
|
||||||
this.domElement.setAttribute('class', 'guidat-controller ' + this.type);
|
this.domElement.setAttribute('class', 'guidat-controller ' + this.type);
|
||||||
|
@ -402,6 +402,10 @@ DAT.GUI = function(parameters) {
|
|||||||
|
|
||||||
this.reset = function() {
|
this.reset = function() {
|
||||||
// TODO ... Set all values back to their initials.
|
// TODO ... Set all values back to their initials.
|
||||||
|
for (var i = 0, l = DAT.GUI.allControllers.length; i < l; i++) {
|
||||||
|
// apply to each controller
|
||||||
|
DAT.GUI.allControllers[i].reset();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.toggle = function() {
|
this.toggle = function() {
|
||||||
@ -733,4 +737,4 @@ DAT.GUI.removeClass = function(domElement, className) {
|
|||||||
|
|
||||||
if (DAT.GUI.getVarFromURL('saveString') != null) {
|
if (DAT.GUI.getVarFromURL('saveString') != null) {
|
||||||
DAT.GUI.load(DAT.GUI.getVarFromURL('saveString'));
|
DAT.GUI.load(DAT.GUI.getVarFromURL('saveString'));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user