Hi
I have an editor with custom toolbar buttons which I am able to enable / disable via javascript using the following code:
The custom buttons that I am showing in my toolbar are also a custom contextMenu as in:
The toolbar buttons now only show when the user has selected some text (works great), however, I need to disable / enable the context menus when I am enabllng / disabling my toolbar buttons.
How do I get a ref to the conextmenu via javascript, and do the contextmenus have a setState property?
I have an editor with custom toolbar buttons which I am able to enable / disable via javascript using the following code:
| function OnClientSelectionChange(editor, args) { |
| var enableButton = (editor.getSelection().getText().length > 0) ? 0 : -1; |
| editor.getToolByName("tbiEntity").setState(enableButton); |
| //more buttons are being disbled (not showing for brevity)... |
| } |
The custom buttons that I am showing in my toolbar are also a custom contextMenu as in:
| <contextMenu forElement="*"> |
| <tool name="tbiEntity" Text="Entity (Ctrl+Shift+E)" /> |
| <!-- more here --> |
| </contextMenu> |
The toolbar buttons now only show when the user has selected some text (works great), however, I need to disable / enable the context menus when I am enabllng / disabling my toolbar buttons.
How do I get a ref to the conextmenu via javascript, and do the contextmenus have a setState property?