From be7cbf01cafda7863a0955e443237b15c2531105 Mon Sep 17 00:00:00 2001 From: Christopher McCulloh Date: Wed, 26 Nov 2014 15:05:18 -0500 Subject: [PATCH] (848---simplified-checkbox-fix) fixes issue #848 where checkbox breaks from rapid clicking --- js/checkbox.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/checkbox.js b/js/checkbox.js index b5dacd2b0..1497c324b 100644 --- a/js/checkbox.js +++ b/js/checkbox.js @@ -50,6 +50,7 @@ // handle events this.$element.on('change.fu.checkbox', $.proxy( this.itemchecked, this )); + this.$label.on('click', $.proxy(this.toggle, this));//make repeated label clicks work // set default state this.setState(); @@ -107,10 +108,12 @@ return this.state.checked; }, - toggle: function() { - this.state.checked = !this.state.checked; + toggle: function(e) { + if (!e || e.currentTarget === e.originalEvent.target) { + this.state.checked = !this.state.checked; - this._toggleCheckedState(); + this._toggleCheckedState(); + } }, toggleContainer: function(){