mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-05 17:28:06 +02:00
* Start (mostly placeholder) for MultiLineEditTextView
This commit is contained in:
parent
0d9add70bd
commit
3bf34487d7
6 changed files with 160 additions and 69 deletions
|
@ -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());
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue