-
Notifications
You must be signed in to change notification settings - Fork 744
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
item.callback not triggered when item.disabled callback returns false. #2
Comments
(note, when I originally logged this issue, I mis-stated that the behavior occurs when item.disabled returns true. That was an error in describing the problem on my part. The issue does exist as is evident by the steps to reproduce I outline. |
Looks like the issue is with line 528 of jquery.contextMenu.js... in the case when opt.items[key].disabled is not a simple property but rather a callback function, that second parameter to the if condition returns true (because it is true that .disabled is there -- it is a function declaration. If I get a chance, I'll work this up in a fork and submit a pull request. |
In case I never get around to that:
|
Thanks, missed this at the initial rewrite. Fixed! |
If an item declares a callback function for its 'disabled' property, when that callback returns false, the subsequent item.callback is not called.
The Demo at http://medialize.github.com/jQuery-contextMenu/demo.html shows this behavior.
To reproduce, load the Demo page and in "menu 2" of the first demo, attempt to select the Golf menu item, which is not disabled. The item's callback (alert_click) is never fired.
The text was updated successfully, but these errors were encountered: