dat.gui/elements/dat-gui-string/dat-gui-string.js

29 lines
357 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-09 19:53:30 +00:00
Gui.register( 'dat-gui-string', function( value ) {
2014-08-27 00:01:15 +00:00
2014-09-08 01:31:51 +00:00
return typeof value == 'string';
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-09 19:53:30 +00:00
Polymer( 'dat-gui-string', {
2014-08-27 00:01:15 +00:00
2014-09-08 01:31:51 +00:00
click: function( e ) {
2014-09-03 16:52:28 +00:00
2014-09-08 01:31:51 +00:00
this.$.input.select();
2014-09-03 16:52:28 +00:00
2014-09-08 01:31:51 +00:00
},
2014-09-03 16:52:28 +00:00
2014-09-08 01:31:51 +00:00
keydown: function( e ) {
2014-09-03 16:52:28 +00:00
2014-09-08 01:31:51 +00:00
if ( e.keyCode == 13 ) {
this.$.input.blur();
}
2014-09-08 01:31:51 +00:00
}
2014-09-08 01:31:51 +00:00
} );