Skip to content

Instantly share code, notes, and snippets.

@unicolet
Created February 10, 2013 09:27
Show Gist options
  • Save unicolet/4748964 to your computer and use it in GitHub Desktop.
Save unicolet/4748964 to your computer and use it in GitHub Desktop.
Add action support on checkbox click
MyApp.CheckableListItemView = SC.ListItemView.extend({
/** @private in SC.ListItemView
*
* Overridden here to handle events on checkbox
*/
mouseUp: function(evt) {
var ret = sc_super();
// check event was on checkbox
if(this._isInsideCheckbox(evt)) {
var pane = this.get('pane'),
del = this.displayDelegate,
target = this.getDelegateProperty('checkboxTarget', del),
action = this.getDelegateProperty('checkboxAction', del);
if (action && pane) {
pane.rootResponder.sendAction(action, target, this, pane);
}
}
return ret;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment