mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
shim
This commit is contained in:
parent
8a70c838b9
commit
338a0bbb77
1
build/gui.shim.js
Normal file
1
build/gui.shim.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
!function(n){"use strict";var t=function(){this.defined={}};t.ready=function(n){n()},t.prototype.define=function(n,t){return this.defined[n]=t,e},t.prototype.add=function(){return e};var i=function(){return this},e={on:i};n.Gui=t}(this);
|
39
elements/shim.js
Normal file
39
elements/shim.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
// Use gui.shim.js in production when you want to use dat.gui to recall values without any of the interface.
|
||||||
|
( function( scope ) {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var Gui = function() {
|
||||||
|
|
||||||
|
this.defined = {};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
Gui.ready = function( fnc ) {
|
||||||
|
|
||||||
|
fnc();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
Gui.prototype.define = function( name, value ) {
|
||||||
|
|
||||||
|
this.defined[ name ] = value;
|
||||||
|
return controllerShim;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
Gui.prototype.add = function( object, path ) {
|
||||||
|
|
||||||
|
return controllerShim;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
var identity = function() { return this; };
|
||||||
|
|
||||||
|
var controllerShim = {
|
||||||
|
on: identity
|
||||||
|
};
|
||||||
|
|
||||||
|
scope.Gui = Gui;
|
||||||
|
|
||||||
|
} )( this );
|
Loading…
Reference in New Issue
Block a user