dat.gui/elements/controller-boolean/controller-boolean.js

23 lines
271 B
JavaScript
Raw Normal View History

2014-09-04 04:14:36 +00:00
/* globals Gui, Polymer */
2014-09-08 01:27:32 +00:00
2014-09-04 04:14:36 +00:00
2014-09-08 01:31:51 +00:00
Gui.register( 'controller-boolean', function( value ) {
2014-08-27 00:01:15 +00:00
2014-09-08 01:31:51 +00:00
return typeof value == 'boolean';
2014-09-08 01:31:51 +00:00
} );
2014-09-08 01:31:51 +00:00
Polymer( 'controller-boolean', {
2014-09-08 01:31:51 +00:00
ready: function() {
2014-08-27 00:01:15 +00:00
2014-09-08 01:31:51 +00:00
},
2014-08-27 00:01:15 +00:00
2014-09-08 01:31:51 +00:00
toggle: function() {
2014-08-27 00:01:15 +00:00
2014-09-08 01:31:51 +00:00
this.value = !this.value;
2014-08-27 00:01:15 +00:00
2014-09-08 01:31:51 +00:00
}
2014-08-27 00:01:15 +00:00
2014-09-08 01:38:29 +00:00
} );