Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to add a class to a custom tinyMCE button?

I have a a webpage in which i use jQuery UI and tinyMCE in combination. I have added a custom button with the intention to use this button to drag a draggeble textfield:

image of button

the code:

editor.addButton('drag', {
                text: 'Drag',
                icon: false,
                onclick: function() {
                // somehow add the class '.handle' to the drag button
                }
            });
        }

Can i add a class ".handle" to the custom tinyMCE drag button? or is this not posible.

like image 657
Mister Verleg Avatar asked Oct 19 '22 21:10

Mister Verleg


1 Answers

You can add a subtype property to the settings.

That will append a class with the name mce-[subtype].

Refer to this codepen

like image 182
Jeff Meatball Yang Avatar answered Oct 23 '22 10:10

Jeff Meatball Yang