minor reformatting
This commit is contained in:
parent
28b9614083
commit
91275f7171
1 changed files with 14 additions and 15 deletions
|
@ -1088,36 +1088,35 @@ Ox.List = function(options, self) {
|
|||
if (self.options.orientation == 'horizontal') {
|
||||
if (self.options.centered) {
|
||||
that.animate({
|
||||
scrollLeft: (self.listMargin / 2 + (pos + 0.5) * itemWidth - that.width() / 2) + 'px'
|
||||
scrollLeft: self.listMargin / 2 + (pos + 0.5) * itemWidth
|
||||
- that.width() / 2 + 'px'
|
||||
}, 250);
|
||||
} else {
|
||||
positions[0] = pos * itemWidth + self.listMargin / 2;
|
||||
positions[1] = positions[0] + itemWidth + self.itemMargin / 2;
|
||||
scroll = that.scrollLeft();
|
||||
size = getWidth();
|
||||
// fixme: css instead of animate(0)?
|
||||
if (positions[0] < scroll || leftOrTopAlign) {
|
||||
that.animate({
|
||||
scrollLeft: positions[0] + 'px'
|
||||
}, 0);
|
||||
that.animate({scrollLeft: positions[0] + 'px'}, 0);
|
||||
} else if (positions[1] > scroll + size) {
|
||||
that.animate({
|
||||
scrollLeft: (positions[1] - size) + 'px'
|
||||
}, 0);
|
||||
that.animate({scrollLeft: (positions[1] - size) + 'px'}, 0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
positions[0] = (self.options.orientation == 'vertical' ? pos : getRow(pos)) * itemHeight;
|
||||
positions[1] = positions[0] + itemHeight + (self.options.orientation == 'vertical' ? 0 : self.itemMargin);
|
||||
positions[0] = (
|
||||
self.options.orientation == 'vertical' ? pos : getRow(pos)
|
||||
) * itemHeight;
|
||||
positions[1] = positions[0] + itemHeight + (
|
||||
self.options.orientation == 'vertical' ? 0 : self.itemMargin
|
||||
);
|
||||
scroll = that.scrollTop();
|
||||
size = getHeight();
|
||||
// fixme: css instead of animate(0)?
|
||||
if (positions[0] < scroll || leftOrTopAlign) {
|
||||
that.animate({
|
||||
scrollTop: positions[0] + 'px'
|
||||
}, 0);
|
||||
that.animate({scrollTop: positions[0] + 'px'}, 0);
|
||||
} else if (positions[1] > scroll + size) {
|
||||
that.animate({
|
||||
scrollTop: (positions[1] - size) + 'px'
|
||||
}, 0);
|
||||
that.animate({scrollTop: (positions[1] - size) + 'px'}, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue