Created
August 21, 2009 11:26
-
-
Save thomaslang/171882 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| contentView: SC.ListView.design({ | |
| listItemActionProperty: 'action', | |
| contentValueKey: "title", | |
| contentBinding: "BB.associationListController.arrangedObjects", | |
| exampleView: SC.ListItemView.extend({ | |
| renderAction: function(context, actionClassName){ | |
| context.push('<img src="', | |
| SC.BLANK_IMAGE_URL, | |
| '" class="action sc-mini-icon plus" />'); | |
| }, | |
| mouseDown: function(evt) { | |
| // if inside action icon | |
| if (this._isInsideElementWithClassName('action', evt)) { | |
| console.log('action triggered'); | |
| return YES; // listItem should handle this event | |
| } | |
| // if occurred inside checkbox, item view should handle the event. | |
| if (this._isInsideCheckbox(evt)) { | |
| this._addCheckboxActiveState() ; | |
| this._isMouseDownOnCheckbox = YES ; | |
| this._isMouseInsideCheckbox = YES ; | |
| return YES ; // listItem should handle this event | |
| } else if (this._isInsideDisclosure(evt)) { | |
| this._addDisclosureActiveState(); | |
| this._isMouseDownOnDisclosure = YES; | |
| this._isMouseInsideDisclosure = YES ; | |
| return YES; | |
| } | |
| return NO ; // let the collection view handle this event | |
| } | |
| }) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment