Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

callback docs are wrong #571

Closed
tisdall opened this issue Sep 28, 2017 · 2 comments
Closed

callback docs are wrong #571

tisdall opened this issue Sep 28, 2017 · 2 comments

Comments

@tisdall
Copy link

tisdall commented Sep 28, 2017

The docs for callback say that it takes 4 args and they are (itemKey, opt, rootMenu, originalEvent). However, looking at the source code shows this: callback.call(root.$trigger, key, root, e). So, the docs should drop the "rootMenu" as there's only 3 args passed and the third is the event. (maybe the docs should also state that this is assigned to be opt.$trigger)

@tisdall
Copy link
Author

tisdall commented Sep 28, 2017

... originalEvent should probably just be event as the event passed is a regular jQuery event and the "original" is an attribute off of that passed event.

In other words, if you access the value that's passed (let's call it event) you can see that it has the original event as an attribute (so event.originalEvent is the actual original event, not the passed in value event).

@bbrala
Copy link
Member

bbrala commented Oct 2, 2017

Hmm, good point. It should at least correctly mention how it works now. Thanks for pointing this out.

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

No branches or pull requests

2 participants