TinyMCE:API/tinymce.Editor/onEvent

From Moxiecode Documentation Wiki

Jump to: navigation, search

Contents

Event: onEvent

Summary

This event gets executed when a DOM event occurs inside the editor contents like a key down or mouse click.

Syntax

event_callback(<tinymce.Editor> ed, <Event> e)

Parameters

ed
Sender object/Editor instance that the event occurred in.
e
DOM Event object, includes things like target for the event.

Examples

// Adds an observer to the onEvent event using tinyMCE.init
tinyMCE.init({
   ...
   setup : function(ed) {
      ed.onEvent.add(function(ed, e) {
          console.debug('Editor event occured: ' + e.target.nodeName);
      });
   }
});

// Adds an observer to the onEvent event using the render method
var ed = new tinymce.Editor('someid', {
   .. Some settings
});

ed.onEvent.add(function(ed, e) {
   console.debug('Editor was clicked: ' + e.target.nodeName);
});

ed.render();
Personal tools