Skip to content

Commit 02db217

Browse files
committed
Allow passing data-properties to menu items.
Usage: menu: [ { title: 'item a', data: { id: 123, 'some-other-property': 42, action: ... } ] which adds data-id="123" data-some-other-property="42" to the a-element.
1 parent d174e1f commit 02db217

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

jquery.ui-contextmenu.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ $.extend($.moogle.contextmenu, {
306306
if(entry.disabled){
307307
$parentLi.addClass("ui-state-disabled");
308308
}
309+
if($.isPlainObject(entry.data)){
310+
$a.data(entry.data);
311+
}
309312
}
310313
return $a;
311314
},

0 commit comments

Comments
 (0)