blink, inverse, invisible.

This commit is contained in:
Christopher Jeffrey 2013-06-13 02:22:01 -05:00
parent 461af61a59
commit 607013b22b
1 changed files with 24 additions and 0 deletions

View File

@ -567,6 +567,9 @@ function Element(options) {
this.bg = convert(options.bg);
this.bold = options.bold ? 1 : 0;
this.underline = options.underline ? 2 : 0;
this.blink = options.blink ? 4 : 0;
this.inverse = options.inverse ? 8 : 0;
this.invisible = options.invisible ? 16 : 0;
this.fixed = options.fixed || false;
this.border = options.border;
@ -577,6 +580,9 @@ function Element(options) {
this.border.ch = this.border.ch || ' ';
this.border.bold = this.border.bold ? 1 : 0;
this.border.underline = this.border.underline ? 2 : 0;
this.border.blink = this.border.blink ? 4 : 0;
this.border.inverse = this.border.inverse ? 8 : 0;
this.border.invisible = this.border.invisible ? 16 : 0;
}
if (options.clickable) {
@ -1337,6 +1343,9 @@ function List(options) {
this.selectedFg = convert(options.selectedFg);
this.selectedBold = options.selectedBold ? 1 : 0;
this.selectedUnderline = options.selectedUnderline ? 2 : 0;
this.selectedBlink = options.selectedBlink ? 4 : 0;
this.selectedInverse = options.selectedInverse ? 8 : 0;
this.selectedInvisible = options.selectedInvisible ? 16 : 0;
this.mouse = options.mouse || false;
@ -1441,6 +1450,21 @@ List.prototype.select = function(index) {
this.items[index].underline = this.selectedUnderline;
}
if (this.selectedBlink != null) {
this.items[this.selected].blink = this.blink;
this.items[index].blink = this.selectedBlink;
}
if (this.selectedInverse != null) {
this.items[this.selected].inverse = this.inverse;
this.items[index].inverse = this.selectedInverse;
}
if (this.selectedInvisible != null) {
this.items[this.selected].invisible = this.invisible;
this.items[index].invisible = this.selectedInvisible;
}
var diff = index - this.selected;
this.selected = index;
this.scroll(diff);