List: use on, not scroll; cosmetic changes

This commit is contained in:
rlx 2014-09-22 16:24:11 +02:00
parent 5314f6c73a
commit ac3b736e72

View file

@ -116,7 +116,9 @@ Ox.List = function(options, self) {
sort: updateSort,
sortable: updateSortable
})
.scroll(scroll);
.on({
scroll: scroll
});
self.options.sort = self.options.sort.map(function(sort) {
return Ox.isString(sort) ? {
@ -530,7 +532,11 @@ Ox.List = function(options, self) {
function findCell(e) {
var $element = $(e.target);
while (!$element.is('.OxCell') && !$element.is('.OxPage') && !$element.is('body')) {
while (
!$element.is('.OxCell')
&& !$element.is('.OxPage')
&& !$element.is('body')
) {
$element = $element.parent();
}
return $element.is('.OxCell') ? $element : null;
@ -849,12 +855,12 @@ Ox.List = function(options, self) {
result.data.items.forEach(function(v, i) {
var pos = offset + i;
self.$items[pos] = Ox.ListItem({
construct: self.options.construct,
data: v,
//format: self.options.format,
position: pos,
unique: self.options.unique
});
construct: self.options.construct,
data: v,
//format: self.options.format,
position: pos,
unique: self.options.unique
});
isSelected(pos) && self.$items[pos].addClass('OxSelected');
self.$items[pos].appendTo(self.$pages[page]);
});