TinyMCE:API/tinymce.Editor/onDeactivate

From Moxiecode Documentation Wiki

Jump to: navigation, search

Contents

Event: onDeactivate

Summary

This event gets executed an editor is deactivated in other words when the user activates another editor instance. This is not the same as focus/blur since it will not get fired when you focus other elements like input elements.

Syntax

event_callback(<tinymce.Editor> ed, <tinymce.Editor> aed)

Parameters

ed
Sender object/Editor instance reference the editor that got deactivated.
aed
Editor instance that got activated instead.

Examples

// Adds an observer to the onDeactivate event using tinyMCE.init
tinyMCE.init({
   ...
   setup : function(ed) {
      ed.onDeactivate.add(function(ed) {
          console.debug('Editor was deactivated: ' + ed.id);
      });
   }
});

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

ed.onDeactivate.add(function(ed) {
   console.debug('Editor was deactivated: ' + ed.id);
});

ed.render();
Personal tools