TinyMCE:API/tinymce.util.Dispatcher

From Moxiecode Documentation Wiki

Jump to: navigation, search

Contents

Class: tinymce.util.Dispatcher

This class is used to dispatch event to observers/listeners. All internal events inside TinyMCE uses this class, this can be used to create your own events inside a plugin.

Constructor

Dispatcher
Constructs a new event dispatcher object.

Methods

add
Add an observer function to be executed when a dispatch call is done.
addToTop
Add an observer function to be executed to the top of the list of observers.
dispatch
Dispatches an event to all observers/listeners.
remove
Removes an observer function.

Examples

// Creates a custom event
this.onSomething = new tinymce.util.Dispatcher(this);

// Dispatch/fire the event
this.onSomething.dispatch('some string');
Personal tools