Skip to content
New issue

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

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

Already on GitHub? # to your account

Error on try to recreate menu after destroy #397

Closed
punk2x opened this issue May 20, 2016 · 1 comment
Closed

Error on try to recreate menu after destroy #397

punk2x opened this issue May 20, 2016 · 1 comment
Labels

Comments

@punk2x
Copy link

punk2x commented May 20, 2016

When try to recreate menu on same selector, after destroy, causes the following error:

Uncaught TypeError: Cannot read property 'disabled' of undefined

your code:

disabled = ($.isFunction(item.disabled) && item.disabled.call($trigger, key, root)) || item.disabled === true,

On case 'destroy': ... if (o.context !== context) Is always false, and don't destroy anything. Removing this validation, all works.

My "destroy" code:
$(".my-context").contextMenu("destroy");

Tested on google chrome (50.0).

@bbrala bbrala added the Bug label May 24, 2016
@bbrala bbrala closed this as completed in e738733 Aug 26, 2016
@bbrala
Copy link
Member

bbrala commented Aug 26, 2016

Refactored the context part to something more sane. Should be fixed in master now.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants