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

Build option/callback does not include event location #24

Closed
rmacfadyen opened this issue Jan 8, 2012 · 1 comment
Closed

Build option/callback does not include event location #24

rmacfadyen opened this issue Jan 8, 2012 · 1 comment

Comments

@rmacfadyen
Copy link

The option 'build'
{selector: ".awesome-menu",
build: function($trigger){
return {
callback: function(){},
items: {
foo: {name: "Foo"}
}
};
}};

does not pass the location the mouse event occurred at.

This would be useful for working with context menu for a CANVAS element where the context menu to be displayed depends on what the mouse is pointing at.

Changing line 205 from:
$.extend(true, e.data, defaults, e.data.build($currentTrigger) || {});

to:
$.extend(true, e.data, defaults, e.data.build($currentTrigger, { pageX: e.pageX, pageY: e.pageY }) || {});

Adds support for passing the location to the build function.

@rodneyrehm
Copy link
Contributor

Fixed in version 1.5.6

baohx2000 pushed a commit to Contatta/jQuery-contextMenu that referenced this issue Jun 18, 2012
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