TinyMCE:API/tinymce.Editor/onVisualAid

From Moxiecode Documentation Wiki

Jump to: navigation, search

Contents

Event: onVisualAid

Summary

This event gets executed when visual representation for hidden elements are toggled on or off. This enables you to show or hide hidden elements inside the editor in your plugin, for example hidden tables get dotted borders, etc.

Syntax

event_callback(<tinymce.Editor> ed, <Element> e, <Boolean> s)

Parameters

ed
Sender object/Editor instance reference.
e
Root element to loop though to visualize hidden elements etc.
s
State true/false to show/hide the visual aids.

Examples

// Adds an observer to the onVisualAid event using tinyMCE.init
tinyMCE.init({
   ...
   setup : function(ed) {
      ed.onVisualAid.add(function(ed, e, s) {
          console.debug('onVisualAid event: ' + ed.id + ", State: " + s);
      });
   }
});

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

ed.onVisualAid.add(function(ed, e, s) {
   console.debug('onVisualAid event: ' + ed.id + ", State: " + s);
});

ed.render();
Personal tools