diff --git a/lib/widget.js b/lib/widget.js index bc9c7e3..8900298 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -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);