Mister Verleg
Mister Verleg

Reputation: 4303

How do i add extra functionality to an existing tinyMCE button?

I want to add some extra functionality to the standard buttons in tinyMCE and I was wondering how this can be done.

For example,

If i want this paste button to not only paste the content, But do some custom things as well. (like add a class, or change the size etc).

TinyMCE Buttons

How do i extend the functionality of such a button?

Upvotes: 2

Views: 119

Answers (1)

Thariama
Thariama

Reputation: 50832

This was easier with Tinymce3 where it was very easy to get the button and change the executed command.

Now with Tinymce4 you can solve this as follows:

  • unbind any events of the paste-Span in the dom and bind your own click-handler executing your custom code and then the regular tinymce paste command

Upvotes: 1

Related Questions