minor changes
This commit is contained in:
parent
05828db75d
commit
9e8a0ca296
1 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue