dat.gui/controllers/controller.string.js
Mr.doob 46b5d1ff24 Added updateValue method to StringController (so watched string controllers update).
Moved easing from margin-top to height. It's now showing an ugly scrollbar jump. Hmm...
2011-01-29 02:25:48 +00:00

34 lines
711 B
JavaScript

var StringController = function() {
this.type = "string";
var _this = this;
Controller.apply(this, arguments);
var input = document.createElement('input');
var initialValue = this.getValue();
input.setAttribute('value', initialValue);
input.setAttribute('spellcheck', 'false');
this.domElement.addEventListener('mouseup', function() {
input.focus();
input.select();
}, false);
input.addEventListener('keyup', function() {
_this.setValue(input.value);
}, false);
this.domElement.appendChild(input);
this.updateValue = function(val) {
input.setAttribute('value', val);
}
};
StringController.prototype = new Controller();
StringController.prototype.constructor = StringController;