diff --git a/source/Ox.UI/js/Panel/SplitPanel.js b/source/Ox.UI/js/Panel/SplitPanel.js index bd17acd2..0315b70e 100644 --- a/source/Ox.UI/js/Panel/SplitPanel.js +++ b/source/Ox.UI/js/Panel/SplitPanel.js @@ -184,7 +184,7 @@ Ox.SplitPanel = function(options, self) { that.getSize = function(id) { var pos = Ox.isNumber(id) ? id : getPositionById(id), element = self.options.elements[pos]; - return element.element[self.dimensions[0]]() * !that.isCollapsed(pos); + return element.element[self.dimensions[0]]() * !that.isCollapsed(pos); }; /*@ @@ -234,12 +234,12 @@ Ox.SplitPanel = function(options, self) { if (Ox.isNumber(element.size)) { that.size(i, element.size); if (element.collapsible || element.resizable) { - self.$resizebars[i == 0 ? 0 : 1].options({ + self.$resizebars[i == 0 ? 0 : 1].options({ collapsible: element.collapsible, resizable: element.resizable, - size: element.size - }); - } + size: element.size + }); + } } that.replace(i, element.element); }); @@ -261,17 +261,17 @@ Ox.SplitPanel = function(options, self) { that.reset = function(id) { // one can pass pos instead of id var pos = Ox.isNumber(id) ? id : getPositionById(id), - element = self.options.elements[pos]; - element.size = self.defaultSize[pos]; - setSizes(false, function() { - element.element.triggerEvent('resize', { + element = self.options.elements[pos]; + element.size = self.defaultSize[pos]; + setSizes(false, function() { + element.element.triggerEvent('resize', { size: element.size }); element = self.options.elements[pos == 0 ? 1 : pos - 1]; element.element.triggerEvent('resize', { - size: element.element[self.dimensions[0]]() - }); - }); + size: element.element[self.dimensions[0]]() + }); + }); }; /*@ @@ -288,13 +288,13 @@ Ox.SplitPanel = function(options, self) { var pos = Ox.isNumber(id) ? id : getPositionById(id), element = self.options.elements[pos], animate = {}; - if (arguments.length == 1) { - return element.element[self.dimensions[0]]() * !that.isCollapsed(pos); - } else { - element.size = size; + if (arguments.length == 1) { + return element.element[self.dimensions[0]]() * !that.isCollapsed(pos); + } else { + element.size = size; setSizes(false, callback); return that; - } + } }; /*@ @@ -302,10 +302,11 @@ Ox.SplitPanel = function(options, self) { (id) -> The SplitPanel id The element's id or position @*/ + // FIXME: isn't 'toggle' reserved by jQuery? that.toggle = function(id) { // one can pass pos instead of id var pos = Ox.isNumber(id) ? id : getPositionById(id), - element = self.options.elements[pos], + element = self.options.elements[pos], value = parseInt(that.css(self.edges[pos == 0 ? 0 : 1]), 10) + element.element[self.dimensions[0]]() * (element.collapsed ? 1 : -1), animate = {}; @@ -316,10 +317,10 @@ Ox.SplitPanel = function(options, self) { collapsed: element.collapsed }); self.$resizebars[pos == 0 ? 0 : 1].options({collapsed: element.collapsed}); - element = self.options.elements[pos == 0 ? 1 : pos - 1]; + element = self.options.elements[pos == 0 ? 1 : pos - 1]; element.element.triggerEvent('resize', { - size: element.element[self.dimensions[0]]() - }); + size: element.element[self.dimensions[0]]() + }); }); };