list resizing.
This commit is contained in:
parent
b597bdd1c1
commit
b0b949b301
|
@ -1498,6 +1498,21 @@ function List(options) {
|
|||
// self.emit('select', self.items[self.selected], self.selected);
|
||||
// }
|
||||
// });
|
||||
|
||||
function resize() {
|
||||
var visible = self.height - (self.border ? 2 : 0);
|
||||
if (visible >= self.selected + 1) {
|
||||
//if (self.selected < visible - 1) {
|
||||
self.childBase = 0;
|
||||
self.childOffset = self.selected;
|
||||
} else {
|
||||
self.childBase = self.selected - visible + 1;
|
||||
self.childOffset = visible - 1;
|
||||
}
|
||||
}
|
||||
|
||||
this.screen.on('resize', resize);
|
||||
this.on('resize', resize);
|
||||
}
|
||||
|
||||
List.prototype.__proto__ = ScrollableBox.prototype;
|
||||
|
|
Loading…
Reference in New Issue