better layout for text lists that don't fill the screen
This commit is contained in:
parent
74205d988b
commit
11fe22e879
1 changed files with 19 additions and 2 deletions
|
@ -2677,6 +2677,23 @@ requires
|
|||
}
|
||||
self.$items[pos].appendTo(self.$pages[page]);
|
||||
});
|
||||
if (self.options.type == "text" && page == 0) {
|
||||
var height = that.height(),
|
||||
visibleItems = Math.ceil(height / self.options.itemHeight);
|
||||
if (result.data.items.length < visibleItems) {
|
||||
self.$pages[page].height(height).css({
|
||||
overflow: "hidden"
|
||||
});
|
||||
$.each(Ox.range(result.data.items.length, visibleItems), function(i, v) {
|
||||
new Ox.ListItem({
|
||||
construct: self.options.construct,
|
||||
data: {},
|
||||
id: "",
|
||||
position: v
|
||||
}).appendTo(self.$pages[page]);
|
||||
});
|
||||
}
|
||||
}
|
||||
self.$pages[page].appendTo(that.$content);
|
||||
!Ox.isUndefined(callback) && callback();
|
||||
},
|
||||
|
@ -3093,8 +3110,8 @@ requires
|
|||
width: (self.columnWidths[i] - 9) + "px",
|
||||
textAlign: v.align
|
||||
})
|
||||
.html(data[v.id])
|
||||
.appendTo($item)
|
||||
.html(!$.isEmptyObject(data) ? data[v.id] : "")
|
||||
.appendTo($item);
|
||||
});
|
||||
return $item;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue