fix a bug in Ox.ButtonGroup

This commit is contained in:
rlx 2011-09-18 02:06:33 +00:00
parent ff0b83fa89
commit 7f98cd19f2

View file

@ -63,12 +63,12 @@ Ox.ButtonGroup = function(options, self) {
function selectButton(pos) { function selectButton(pos) {
var toggled = self.optionGroup.toggle(pos); var toggled = self.optionGroup.toggle(pos);
if (toggled.length) { if (toggled.length) {
toggled.forEach(function(pos, i) { toggled.forEach(function(pos) {
self.$buttons[pos].toggleSelected(); self.$buttons[pos].toggleSelected();
}); });
that.triggerEvent('change', { that.triggerEvent('change', {
selected: self.optionGroup.selected().map(function(i) { selected: self.optionGroup.selected().map(function(i) {
return self.options.buttons[v].id; return self.options.buttons[i].id;
}) })
}); });
} }