fix selecting tab via .select in tab panel

This commit is contained in:
j 2012-01-31 13:23:24 +00:00
parent d10deb81aa
commit 319608b5ac
2 changed files with 11 additions and 1 deletions

View file

@ -96,6 +96,16 @@ Ox.ButtonGroup = function(options, self) {
}
}
self.setOption = function(key, value) {
if (key == 'value') {
// fixme: this doesn't work in cases where
// multiple buttons can be selected
var position = Ox.getIndexById(self.options.buttons, value);
if (position > -1) {
self.$buttons[position].trigger('click');
}
}
}
return that;
};

View file

@ -57,7 +57,7 @@ Ox.TabPanel = function(options, self) {
that.select = function(id) {
if (Ox.getIndexById(self.options.tabs, id) > -1) {
self.$tabs.select(id);
self.$tabs.options({value: id});
}
};