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

@ -58,8 +58,8 @@ Ox.SplitPanel = function(options, self) {
size: 'auto'
}, element);
that.$elements[i] = element.element
.css(self.edges[2], (parseInt(element.element.css(self.edges[2])) || 0) + 'px')
.css(self.edges[3], (parseInt(element.element.css(self.edges[3])) || 0) + 'px');
.css(self.edges[2], (parseInt(element.element.css(self.edges[2]), 10) || 0) + 'px')
.css(self.edges[3], (parseInt(element.element.css(self.edges[3]), 10) || 0) + 'px');
});
// create resizebars
@ -123,8 +123,8 @@ Ox.SplitPanel = function(options, self) {
// is about elements that are collapsed splitpanels
var css = {},
edges = [
(init && parseInt(that.$elements[i].css(self.edges[0]))) || 0,
(init && parseInt(that.$elements[i].css(self.edges[1]))) || 0
(init && parseInt(that.$elements[i].css(self.edges[0]), 10)) || 0,
(init && parseInt(that.$elements[i].css(self.edges[1]), 10)) || 0
];
if (element.size != 'auto') {
css[self.dimensions[0]] = element.size + 'px';
@ -207,8 +207,8 @@ Ox.SplitPanel = function(options, self) {
// one can pass pos instead of id
var pos = Ox.isNumber(id) ? id : getPositionById(id);
that.$elements[pos] = element
.css(self.edges[2], (parseInt(element.css(self.edges[2])) || 0) + 'px')
.css(self.edges[3], (parseInt(element.css(self.edges[3])) || 0) + 'px');
.css(self.edges[2], (parseInt(element.css(self.edges[2]), 10) || 0) + 'px')
.css(self.edges[3], (parseInt(element.css(self.edges[3]), 10) || 0) + 'px');
Ox.Log('Panel', 'REPLACE ELEMENT')
self.options.elements[pos].element.replaceWith(
self.options.elements[pos].element = element
@ -307,9 +307,8 @@ Ox.SplitPanel = function(options, self) {
// one can pass pos instead of id
var pos = Ox.isNumber(id) ? id : getPositionById(id),
element = self.options.elements[pos],
value = parseInt(that.css(self.edges[pos == 0 ? 0 : 1])) +
element.element[self.dimensions[0]]() *
(element.collapsed ? 1 : -1),
value = parseInt(that.css(self.edges[pos == 0 ? 0 : 1]), 10)
+ element.element[self.dimensions[0]]() * (element.collapsed ? 1 : -1),
animate = {};
animate[self.edges[pos == 0 ? 0 : 1]] = value;
that.animate(animate, 250, function() {