-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Dynamic Context Menu #284
base: develop
Are you sure you want to change the base?
Dynamic Context Menu #284
Conversation
Define the nodes that will have a context menu and which actions are permitted for each node by defining the 'context' option in the editor's options. For example the options below define that only node1, node2, and all the children of node3 and node4 will have a context menu. Moreover, node1 and node2 allow only the 'Remove' action while the children of node3 and node4 allow both the 'Duplicate' and 'Remove' actions. context: { items: { node1: ['Remove'], node2: ['Remove'] }, children: { node3: ['Duplicate', 'Remove'], node4: ['Duplicate', 'Remove'] } }
Thanks Themistoklis. This looks interesting. Some thoughts:
|
# Conflicts: # src/js/Node.js
Yes, definitely a completely dynamic context menu would be much more useful! We can proceed the way you suggest! I prefer we to introduce a new option, instead of using the onEditable, in order to keep it clear. |
Agree |
#438 adds support for custom context menu items. |
Define the nodes with a context menu and the actions that are permitted for each node by defining the 'context' option in the editor's options.
For example the options below define that only node1, node2, and all the children of node3 and node4 will have a context menu. Moreover, node1 and node2 allow only the 'Remove' action while the children of node3 and node4 allow both the 'Duplicate' and 'Remove' actions: