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

Commit

Permalink
Wrapping in boolean if statement and cleaning up comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminNeilDavis committed Dec 16, 2014
1 parent 261cbd9 commit bacd170
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions js/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,14 @@
toggle: function(e) {
//keep event from firing twice in Chrome
if (!e || (e.target === e.originalEvent.target)) {
if(Boolean(e)){
//stop bubbling, otherwise event fires twice in Firefox.
e.preventDefault();
//make change event still fire (prevented by preventDefault)
//
}

this.state.checked = !this.state.checked;

this._toggleCheckedState();
this.$element.trigger('change', e);

if(Boolean(e)){
this.$element.trigger('change', e);
}
}
},

Expand Down

0 comments on commit bacd170

Please sign in to comment.