1
0
Fork 0
forked from 0x2620/oxjs

use base 10 in parseInt, use Math.floor for numbers

This commit is contained in:
rolux 2012-06-13 10:28:21 +02:00
commit 8bc8c57373
19 changed files with 44 additions and 45 deletions

View file

@ -598,7 +598,7 @@ Ox.List = function(options, self) {
}
function getPageByPosition(pos) {
return parseInt(pos / self.options.pageLength);
return Math.floor(pos / self.options.pageLength);
}
function getPageByScrollPosition(pos) {
@ -709,7 +709,7 @@ Ox.List = function(options, self) {
function getScrollPosition() {
// if orientation is both, this returns the
// element position at the current scroll position
return parseInt(
return Math.floor(
that.scrollTop() / (self.options.itemHeight + self.itemMargin)
) * self.rowLength;
}
@ -930,7 +930,7 @@ Ox.List = function(options, self) {
function move(data) {
var clientY = data.clientY - that.offset()['top'],
offset = clientY % 16,
position = Ox.limit(parseInt(clientY / 16), 0, self.$items.length - 1);
position = Ox.limit(Math.floor(clientY / 16), 0, self.$items.length - 1);
if (position < self.drag.pos) {
self.drag.stopPos = position + (offset > 8 ? 1 : 0);
} else if (position > self.drag.pos) {