* Start (mostly placeholder) for MultiLineEditTextView

This commit is contained in:
Bryan Ashby 2015-05-16 14:39:14 -06:00
parent 0d9add70bd
commit 3bf34487d7
6 changed files with 160 additions and 69 deletions

View file

@ -84,6 +84,11 @@ function TextView(options) {
));
};
this.getEndOfTextYPosition = function() {
var offset = Math.min(this.text.length, this.dimens.width);
return this.position.y + offset;
};
this.setText(options.text || '');
}
@ -99,10 +104,8 @@ TextView.prototype.setFocus = function(focused) {
TextView.super_.prototype.setFocus.call(this, focused);
this.redraw();
// position & SGR for cursor
var offset = Math.min(this.text.length, this.dimens.width);
this.client.term.write(ansi.goto(this.position.x, this.position.y + offset));
this.client.term.write(ansi.goto(this.position.x, this.getEndOfTextYPosition()));
this.client.term.write(this.getFocusSGR());
};