minor changes

This commit is contained in:
rolux 2012-06-23 20:22:32 +02:00
parent 05828db75d
commit 9e8a0ca296

View file

@ -31,6 +31,7 @@ Ox.TabPanel = function(options, self) {
}
});
self.isObject = Ox.isObject(self.options.content);
self.selected = getSelected();
self.$bar = Ox.Bar({size: 24});
@ -45,7 +46,7 @@ Ox.TabPanel = function(options, self) {
.bindEvent({
change: function(data) {
self.selected = data.value;
that.$element.replaceElement(1, getContent());
self.$panel.replaceElement(1, getContent());
that.triggerEvent('change', {selected: self.selected});
}
})
@ -68,7 +69,7 @@ Ox.TabPanel = function(options, self) {
that.setElement(self.$panel);
function getContent() {
return Ox.isObject(self.options.content)
return self.isObject
? self.options.content[self.selected]
: self.options.content(self.selected);
}