Skip to content

Commit 32bdc38

Browse files
authored
Add dataAttr option for items. (#702)
Closes #590 Closes #591
1 parent a4a77d2 commit 32bdc38

8 files changed

+33
-6
lines changed

dist/jquery.contextMenu.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Licensed under
1313
* MIT License http://www.opensource.org/licenses/mit-license
1414
*
15-
* Date: 2019-10-05T08:37:44.295Z
15+
* Date: 2019-10-06T14:19:04.540Z
1616
*/
1717
@-webkit-keyframes cm-spin {
1818
0% {

dist/jquery.contextMenu.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Licensed under
1212
* MIT License http://www.opensource.org/licenses/mit-license
1313
*
14-
* Date: 2019-10-05T08:37:44.262Z
14+
* Date: 2019-10-06T14:19:04.506Z
1515
*/
1616

1717
// jscs:disable
@@ -1121,6 +1121,11 @@
11211121
'contextMenu': opt,
11221122
'contextMenuRoot': root
11231123
});
1124+
if(opt.dataAttr){
1125+
$.each(opt.dataAttr, function (key, item) {
1126+
opt.$menu.attr('data-' + opt.key, item);
1127+
});
1128+
}
11241129

11251130
$.each(['callbacks', 'commands', 'inputs'], function (i, k) {
11261131
opt[k] = {};

dist/jquery.contextMenu.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)