fix checkbox group value change handler

This commit is contained in:
rolux 2013-10-31 14:20:49 +01:00
parent 397dc8b903
commit 44b7e5796f

View file

@ -31,9 +31,10 @@ Ox.CheckboxGroup = function(options, self) {
.update({ .update({
value: function() { value: function() {
var value = Ox.clone(self.options.value); var value = Ox.clone(self.options.value);
self.options.checkboxes.forEach(function(checkbox, index) { self.$checkboxes.forEach(function($checkbox, index) {
var checked = Ox.contains(value, checkbox.id); var checked = Ox.contains(value, $checkbox.options('id'));
if (checked != checkbox.checked) { if (checked != $checkbox.value()) {
$checkbox.value(!$checkbox.value());
toggleCheckbox(index); toggleCheckbox(index);
} }
}); });