indeterminate checkboxes...

This commit is contained in:
rlx 2016-02-10 13:24:57 +05:30
parent 2944379b71
commit d9ef18d482

View file

@ -47,7 +47,7 @@ Ox.Checkbox = function(options, self) {
} else {
self.$button.options({values: ['none', 'check']});
self.$button.options({
value: self.options.value ? 'none' : 'check'
value: self.options.value ? 'check' : 'none'
});
}
},
@ -121,7 +121,11 @@ Ox.Checkbox = function(options, self) {
function clickButton() {
self.options.value = !self.options.value;
if (self.options.indeterminate) {
self.options.indeterminate = false;
self.$button.options({values: ['none', 'check']});
self.$button.options({value: self.options.value ? 'check' : 'none'});
}
that.triggerEvent('change', {
value: self.options.value
});