replace tabs with spaces; add fixme

This commit is contained in:
rolux 2012-08-29 17:41:40 +02:00
parent b5a2e80878
commit 5e39926816

View file

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