Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Adding the sourceId property to Custom Context to facilitate getting the... #405

wants to merge 1 commit into


None yet
3 participants

ejzn commented Dec 14, 2012

... source element in the callback

@ejzn ejzn referenced this pull request in blackberry/BB10-WebWorks-Framework Dec 14, 2012


Adding source Id from Custom Context to callback + test #481

@ejzn ejzn closed this Dec 20, 2012

@ejzn ejzn reopened this Dec 20, 2012

@jeffheifetz jeffheifetz and 1 other commented on an outdated diff Dec 20, 2012

@@ -97,7 +97,8 @@ blackberry.ui.contextmenu = {
* @param {String} action.actionId A property that uniquely defines the action to be added to the context menu.
* @param {String} action.label A string that will be displayed to the user describing the custom context to be performed. ie: Edit
* @param {String} action.icon A path to the an image to display in the context menu
- * @callback {Function} callback A function which runs when the menu item action is executed
+ * @callback {Function(sourceId)} callback A function which runs when the menu item action is executed

jeffheifetz Dec 20, 2012


I don't believe this type is consistent with how we document callbacks. Do you prefer the layout this way?


jeffheifetz Dec 20, 2012


I meant that because you made the type Function(sourceId) in your output you know see Function(sourceId)(sourceId: String). I would prefer it to just have type Function and that way it wouldn't have two sets of brackets.


ejzn Dec 20, 2012


Sure that is an easy change


ejzn commented Dec 20, 2012

I'm not sure what the alternative is in this case. JSDocs doesn't provide a clean mechanism of documenting the input paramters to a callback. This way at least it does document it properly here is what it looks like:

@nukulb nukulb closed this Jan 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment