fix 2 typos in SplitPanel

This commit is contained in:
rolux 2014-01-17 11:17:27 +00:00
parent 4372676f1f
commit 2666b13ec1

View file

@ -97,7 +97,8 @@ Ox.SplitPanel = function(options, self) {
self.options.elements.forEach(function(element, i) { self.options.elements.forEach(function(element, i) {
element.collapsed && that.css( element.collapsed && that.css(
self.edges[i == 0 ? 0 : 1], -self.options.elements[i].size + 'px' // left/right (horizontal) or top/bottom (vertical)
self.edges[i == 0 ? 0 : 1], -element.size + 'px'
); );
}); });
@ -121,7 +122,7 @@ Ox.SplitPanel = function(options, self) {
function getVisibleSize(index) { function getVisibleSize(index) {
var element = self.options.elements[index]; var element = self.options.elements[index];
return getSize(element) * !element.collapsed; return getSize(index) * !element.collapsed;
} }
function setSizes(init, animate) { function setSizes(init, animate) {
@ -162,8 +163,7 @@ Ox.SplitPanel = function(options, self) {
} else { } else {
// left (horizontal) or top (vertical) // left (horizontal) or top (vertical)
if (element.size == 'auto') { if (element.size == 'auto') {
css[self.edges[0]] = getVisibleSize(self.options.elements[0]) css[self.edges[0]] = getVisibleSize(0) + getSize(1) + 'px';
+ getSize(1) + 'px';
} else { } else {
css[self.edges[0]] = 'auto'; // fixme: why is this needed? css[self.edges[0]] = 'auto'; // fixme: why is this needed?
} }