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

bug: Add dataAttr option for items #732

Open
afsheen1 opened this issue Sep 12, 2020 · 0 comments
Open

bug: Add dataAttr option for items #732

afsheen1 opened this issue Sep 12, 2020 · 0 comments

Comments

@afsheen1
Copy link

adding html 5 data- attr for each item is not working after checking the source code I found bug which is already reported here. #712 , but still if I fixed plugin not adding data attr to each menu item...

so i did little changes to source code and add following snippets after line # 1183 // create contextMenu items

if (item.dataAttr) { $t.attr('data-'+Object.keys(item.dataAttr), Object.values(item.dataAttr)); }

by adding above snippets I can add data attr to menu items as following.

var items = { firstCommand: { name: "Copy", dataAttr: { menuTitle: "My custom title" } } }

I hope this help someone ,, or maybe will be add in new release of plugin
thanks

@afsheen1 afsheen1 reopened this Sep 13, 2020
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

1 participant