Skip to content

Commit 01a9369

Browse files
committed
The actionHandler is stored in the <li> element instead of the <a> element.
1 parent fa51311 commit 01a9369

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

jquery.ui-contextmenu.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@
136136
// User selected a menu entry
137137
var retval,
138138
isParent = (ui.item.has(">a[aria-haspopup='true']").length > 0),
139-
$a = ui.item.find(">a"),
140-
actionHandler = $a.data("actionHandler");
139+
actionHandler = ui.item.data("actionHandler");
141140
ui.cmd = ui.item.attr("data-command");
142141
ui.target = $(this.currentTarget);
143142
// ignore clicks, if they only open a sub-menu
@@ -332,7 +331,7 @@ $.extend($.moogle.contextmenu, {
332331
href: "#"
333332
}).appendTo($parentLi);
334333
if( $.isFunction(entry.action) ){
335-
$a.data("actionHandler", entry.action);
334+
$parentLi.data("actionHandler", entry.action);
336335
}
337336
if(entry.uiIcon){
338337
$a.append($("<span class='ui-icon' />").addClass(entry.uiIcon));

0 commit comments

Comments
 (0)