Created
February 10, 2013 09:27
-
-
Save unicolet/4748964 to your computer and use it in GitHub Desktop.
Add action support on checkbox click
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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