Skip to content

tinymce 4 how to add event handler

In tinymce 3, it seems that we can do this with :

// Adds a click handler to the current document
tinymce.dom.Event.add(document, 'click', function(e) {
   console.debug(e.target);
});

What is the syntax in tinymce 4 ?
Need to do it after tinymce initialized.

UPDATE : I tried (still don’t work)

tinymce.bind("description", "keyup", function () {
  console.debug('here');
});

Answer

This works :

tinymce.activeEditor.on('keyup', function(e) {
    console.debug("keyup");
});