1

How can I add style (etc. padding-left: 10px;) or css class to an element over the custom Button and custom Context toolbar in TinyMCE 5?

This is what I've came so far:

    editor.ui.registry.addButton('addstyle', {
        icon: 'plus',
        tooltip: 'Align image left',
        onAction: 
    });


    editor.ui.registry.addContextToolbar('imagealignment', {
        predicate: function (node: any) {
            return node.nodeName.toLowerCase() === 'img'
        },
        items: 'addstyle',
        scope: 'node',
        position: 'node'
    });

I am missing what to write on onAction?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62

1 Answers1

0

You need to write on the plugin source file for that particular plugin

Srimoyee Sen
  • 181
  • 9