mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-24 01:38:54 +00:00
improve table resize event listeners.
This commit is contained in:
parent
b9a94f63ce
commit
cf3eb09f9f
@ -6976,11 +6976,8 @@ function Table(options) {
|
||||
this.setData(options.rows || options.data);
|
||||
|
||||
this.on('resize', function() {
|
||||
var rows = self.rows;
|
||||
// XXX Need to clear previous box.
|
||||
self.setData([]);
|
||||
self.screen.render();
|
||||
self.setData(rows);
|
||||
self.setContent('');
|
||||
self.setData(self.rows);
|
||||
self.screen.render();
|
||||
});
|
||||
}
|
||||
@ -7027,7 +7024,7 @@ Table.prototype._calculateMaxes = function() {
|
||||
};
|
||||
|
||||
Table.prototype.setRows =
|
||||
Table.prototype.setData = function(rows, render) {
|
||||
Table.prototype.setData = function(rows) {
|
||||
var self = this
|
||||
, text = ''
|
||||
, line = ''
|
||||
@ -7292,11 +7289,9 @@ function ListTable(options) {
|
||||
this.setData(options.rows || options.data);
|
||||
|
||||
this.on('resize', function() {
|
||||
var rows = self.rows;
|
||||
// XXX Need to clear previous box.
|
||||
self.setData([]);
|
||||
self.screen.render();
|
||||
self.setData(rows);
|
||||
var selected = self.selected;
|
||||
self.setData(self.rows);
|
||||
self.select(selected);
|
||||
self.screen.render();
|
||||
});
|
||||
}
|
||||
|
@ -15,8 +15,8 @@ var table = blessed.listtable({
|
||||
align: 'center',
|
||||
tags: true,
|
||||
keys: true,
|
||||
height: 5,
|
||||
width: '80%',
|
||||
height: '70%',
|
||||
vi: true,
|
||||
mouse: true,
|
||||
style: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user