Updates to drawing, additional props, friendly IP addrs, etc.
This commit is contained in:
@@ -83,6 +83,15 @@ function VerticalMenuView(options) {
|
||||
self.client.term.write(`${ansi.goto(item.row, self.position.col)}${text}`);
|
||||
this.setRenderCacheItem(index, text, item.focused);
|
||||
};
|
||||
|
||||
this.drawRemovedItem = function(index) {
|
||||
if (index <= this.items.length - 1) {
|
||||
return;
|
||||
}
|
||||
const row = this.position.row + index;
|
||||
this.client.term.rawWrite(`${ansi.goto(row, this.position.col)}${ansi.normal()}${this.fillChar.repeat(this.dimens.width)}`)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
util.inherits(VerticalMenuView, MenuView);
|
||||
@@ -123,6 +132,11 @@ VerticalMenuView.prototype.redraw = function() {
|
||||
this.drawItem(i);
|
||||
}
|
||||
}
|
||||
|
||||
const remain = Math.max(0, this.dimens.height - this.items.length);
|
||||
for (let i = this.items.length; i < remain; ++i) {
|
||||
this.drawRemovedItem(i);
|
||||
}
|
||||
};
|
||||
|
||||
VerticalMenuView.prototype.setHeight = function(height) {
|
||||
|
||||
Reference in New Issue
Block a user