-
Notifications
You must be signed in to change notification settings - Fork 746
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
Menu content is not rebuild when right-click is triggered after the first time #104
Comments
I see the problem. This was initially thought to improve things. "Quick Fix": $.contextMenu.handle.layerClick = function() {
var $this = $(this),
root = $this.data('contextMenuRoot');
root.$menu.trigger('contextmenu:hide');
}; this disables the "repositioning" of an already open menu. At some point, this (obviously) needs to become a configuration flag. |
"repositioning" is working fine. I think its problem is that it only update the position. As I try to edit you code, before this "root.position.call(root.$trigger, root, x, y);" in layerClick is invoke. It should some how rebuild the content like you did in "contextMenu:show" which call custom "build" function and set the opt to the contextMenu or how to call this function: "op.update.call($trigger, opt);" as you said that this to update or create context menu |
Well, no. If a menu is open and you left-/right-click on the same element (or its children) the menu should not be rebuilt, just repositioned. At least that was the original idea, seeing that a build() menu could be doing an Ajax call to find out which items to show. Thinking about that, build() is currently missing a callback to allow that asynchronous behavior. I don't want to give up on this idea just yet. |
I have added the |
right-click to show context menu then move to other position then right-click again, content is not rebuild. But if you left-click then right-click it rebuild the content. So, it you want some kind like right-click on specific element with specific content menu. It has to left-click then right-click.
to illustrate the issue: http://jsfiddle.net/xyzxyz442/Zhyr3/5/
The text was updated successfully, but these errors were encountered: