TinyMCE:API/tinymce.util.Dispatcher
From Moxiecode Documentation Wiki
Contents |
[edit]
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.
[edit]
Constructor
- Dispatcher
- Constructs a new event dispatcher object.
[edit]
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.
[edit]
Examples
// Creates a custom event
this.onSomething = new tinymce.util.Dispatcher(this);
// Dispatch/fire the event
this.onSomething.dispatch('some string');
