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

Commit

Permalink
Merge pull request #881 from cormacmccarthy/848---simplified-checkbox…
Browse files Browse the repository at this point in the history
…-fix

(848---simplified-checkbox-fix) fix repeat label click issue
  • Loading branch information
Kevin Parkerson committed Nov 26, 2014
2 parents 25b28a0 + be7cbf0 commit ec1905a
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 ec1905a

Please sign in to comment.