Merge pull request #16 from gjuchault/patch-1
feat(list): allow bigger list items
This commit is contained in:
commit
cad6aceb98
|
@ -79,6 +79,10 @@ function List(options) {
|
|||
this.style.item.focus = this.options.itemFocusEffects;
|
||||
}
|
||||
|
||||
if (this.options.itemHeight) {
|
||||
this.style.item.height = this.options.itemHeight;
|
||||
}
|
||||
|
||||
this.interactive = options.interactive !== false;
|
||||
|
||||
this.mouse = options.mouse || false;
|
||||
|
@ -237,7 +241,7 @@ List.prototype.createItem = function(content) {
|
|||
left: 0,
|
||||
right: (this.scrollbar ? 1 : 0),
|
||||
tags: this.parseTags,
|
||||
height: 1,
|
||||
height: this.style.item.height || 1,
|
||||
hoverEffects: this.mouse ? this.style.item.hover : null,
|
||||
focusEffects: this.mouse ? this.style.item.focus : null,
|
||||
autoFocus: false
|
||||
|
@ -297,7 +301,7 @@ List.prototype.appendItem = function(content) {
|
|||
content = typeof content === 'string' ? content : content.getContent();
|
||||
|
||||
var item = this.createItem(content);
|
||||
item.position.top = this.items.length;
|
||||
item.position.top = this.items.map(i => i.height).reduce((a, b) => a + b, 0);
|
||||
if (!this.screen.autoPadding) {
|
||||
item.position.top = this.itop + this.items.length;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue