Function used to create custom mojo events.
In addition to creating an event with the specified name, the event is also extended such that a isDefaultPrevented() method is available.
Parameter | Type | Description |
---|---|---|
name | String | Name of the event, visible in event.type |
details | String | Hash of custom event properties to be copied to the event object. |
optionalDocument | Element | DOM element to target the event on. Default is current active document. |
optionalBubbles | Boolean | True to set the event propagation behavior to bubble. Defaults to True. |
optionalCancel | Boolean | True to allow the event's default action to be prevented via preventDefault(). Defaults to True. |
Example usage:
var newEv = Mojo.Event.make(Mojo.Event.back, {originalEvent: event}); this.sendEventToCommanders(newEv); if(newEv.defaultPrevented) {Event.stop(event);}
0 Comments