Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
(848---simplified-checkbox-fix) fixes issue #848 where checkbox break…
Browse files Browse the repository at this point in the history
…s from rapid clicking
  • Loading branch information
cmcculloh committed Nov 26, 2014
1 parent 891a03f commit be7cbf0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions js/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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(){
Expand Down

0 comments on commit be7cbf0

Please sign in to comment.