UNPKG

@wiris/mathtype-html-integration-devkit

Version:

Allows to integrate MathType Web into any JavaScript HTML WYSIWYG rich text editor.

45 lines (41 loc) 869 B
export default class Event { /** * @classdesc * This class represents a custom event. Events should be fired by the {@link Listener} class. * * ```js * let customEvent = new Event(); * customEvent.properties = {}; * * let listeners = new Listeners(); * listeners.newListener(eventName, callback); * * listeners.fire(eventName, customEvent) * * ``` * @constructs */ constructor() { /** * Indicates if the event should be cancelled. * @type {Boolean} */ this.cancelled = false; /** * Indicates if the event should be prevented. * @type {Boolean} */ this.defaultPrevented = false; } /** * Cancels the event. */ cancel() { this.cancelled = true; } /** * Prevents the default action. */ preventDefault() { this.defaultPrevented = true; } }