From d9ef18d482ec0f4dd2ccca43d9ab130cb375a2a7 Mon Sep 17 00:00:00 2001 From: rlx Date: Wed, 10 Feb 2016 13:24:57 +0530 Subject: [PATCH] indeterminate checkboxes... --- source/UI/js/Form/Checkbox.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/UI/js/Form/Checkbox.js b/source/UI/js/Form/Checkbox.js index da94a77f..25889585 100644 --- a/source/UI/js/Form/Checkbox.js +++ b/source/UI/js/Form/Checkbox.js @@ -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; - self.options.indeterminate = false; + 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 });