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

Show/Hide events not fired #32

Closed
gruppler opened this issue Feb 21, 2012 · 2 comments
Closed

Show/Hide events not fired #32

gruppler opened this issue Feb 21, 2012 · 2 comments

Comments

@gruppler
Copy link

When I set the events.show and events.hide, they are never fired. It looks like they're not actually making it into the 'opt' object (in other words, they're always the default empty anonymous function).

Here's what my code looks like:

$.contextMenu({
    selector: '#'+$container[0].id + ', #'+$container[0].id+' li > a',
    zIndex: 2000,
    events: {
        show: function(){
            console.log('show', this);
            this.addClass('contextMenu');
        },
        hide: function(){
            console.log('hide', this);
            this.removeClass('contextMenu');
        }
    },
    build: function(){
        ...
    }
});
@rodneyrehm
Copy link
Contributor

You're obviously using the build function. Have you tried returning the show/hide events from there?

The docs clearly state that »With build, only the options selector and ignoreRightClick may be specified in the options object. All other options need to be returned from the build callback.«

@gruppler
Copy link
Author

Ah, missed that part. Thanks for the quick response!

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

No branches or pull requests

2 participants