Disable Buttons for specific nodes in TinyMce V4

23 Views Asked by At

I have written a small initScript to restrict the indent/outdent to only list elements. It works fine. But how do I set the indent/outdent to disabled, if the editor in focusing on an other element.

I have tried it with

editor.on('NodeChange', function (e) {
   let node = editor.selection?.getNode();
   if (['LI', 'OL', 'UL'].includes(node?.nodeName.upperCase)) {
// how to access the indent/outdent buttons here?
   }
});

But I just cant get the indent/outdent buttons, to set the enabled/disabled status. As of v4 there is no more tinymce.ControlManager to get the control instances.

0

There are 0 best solutions below