* Merged changes

This commit is contained in:
Bryan Ashby 2015-04-27 20:23:21 -06:00
commit cb5fc13da5
11 changed files with 217 additions and 16 deletions

View file

@ -37,7 +37,6 @@ EditTextView.prototype.onKeyPress = function(key, isSpecial) {
assert(1 === key.length);
// :TODO: how to handle justify left/center?
if(this.text.length < this.maxLength) {
key = strUtil.stylizeString(key, this.textStyle);
@ -61,8 +60,6 @@ EditTextView.prototype.onKeyPress = function(key, isSpecial) {
};
EditTextView.prototype.onSpecialKeyPress = function(keyName) {
// :TODO: handle 'enter' & others for multiLine
if(this.isSpecialKeyMapped('backspace', keyName)) {
if(this.text.length > 0) {
this.text = this.text.substr(0, this.text.length - 1);
@ -76,10 +73,10 @@ EditTextView.prototype.onSpecialKeyPress = function(keyName) {
}
}
}
} else if(this.isSpecialKeyMapped('clear', keyName)) {
// :TODO: this doesn't work right at all:
//this.setText('');
//this.client.term.write(ansi.goto(this.position.x, this.position.y));
} else if(this.isSpecialKeyMapped('clearLine', keyName)) {
this.text = '';
this.cursorPos.x = 0;
this.setFocus(true); // resetting focus will redraw & adjust cursor
}