TinyMCE for editor plugin events

TinyMCE for editor plugin events

smassotsmassot Posts: 28Questions: 9Answers: 1
edited October 2015 in Plug-ins

Hi all,
on my editor I have 2 fields with TinyMCE plugins on.
My problem is when I open the editor , I take a snapshot (editor.get) of contents that I compare later before closing
the editor in order to check if some modifications are not saved and give an alert.

But unfortunatly, before it was a simple textarea and we already have some data in our database saved without html tag
and so when I try to edit some old text (in plain text format), when I close the editor (without doing anything) I have an alert.

My question is, is there an event on the tinyMCE plugin which could tell me when the plugin is totally up so that I could take my snapshot after content have been tags by the plugins

Thx a lot

Answers

  • allanallan Posts: 57,236Questions: 1Answers: 9,113 Site admin

    The open event is the one that the TinyMCE plug-in listens for itself, so it you add an event listener for that event after the Editor has been initialised (which is the only time you can add events anyway!) it should occur after the TinyMCE has been created, since the events are executed sequentially.

    That does assume that TinyMCE's initialisation is synchronous - I'm afraid I don't know if it is. If not, then you would need to listen for an event from TinyMCE.

    Allan

This discussion has been closed.