2011-01-24 19:38:52 +00:00
|
|
|
var StringController = function() {
|
2011-01-24 20:11:19 +00:00
|
|
|
|
2011-01-24 19:38:52 +00:00
|
|
|
this.type = "string";
|
2011-01-24 20:11:19 +00:00
|
|
|
|
|
|
|
var _this = this;
|
|
|
|
|
2011-01-24 19:38:52 +00:00
|
|
|
Controller.apply(this, arguments);
|
2011-01-24 20:11:19 +00:00
|
|
|
|
2011-01-24 19:38:52 +00:00
|
|
|
var input = document.createElement('input');
|
2011-01-24 20:11:19 +00:00
|
|
|
|
2011-01-24 19:38:52 +00:00
|
|
|
input.setAttribute('value', this.object[this.propertyName]);
|
2011-01-24 20:28:13 +00:00
|
|
|
this.domElement.addEventListener('mouseup', function() {
|
2011-01-24 20:11:19 +00:00
|
|
|
input.focus();
|
2011-01-24 20:28:13 +00:00
|
|
|
input.select();
|
2011-01-24 20:11:19 +00:00
|
|
|
}, false);
|
|
|
|
|
|
|
|
input.addEventListener('keyup', function() {
|
|
|
|
console.log(input.value);
|
|
|
|
_this.setValue(input.value);
|
|
|
|
}, false);
|
|
|
|
|
2011-01-24 19:38:52 +00:00
|
|
|
this.domElement.appendChild(input);
|
|
|
|
};
|
|
|
|
StringController.prototype = new Controller();
|
|
|
|
StringController.prototype.constructor = StringController;
|