Similar to prototype's element.fire(), method, except that the event type can be specified (instead of always dataavailable) and the specified details are placed in the event object directly (instead of a memo subobject). If element is undefined, the new event will just be returned and not actually dispatched.
| Parameter | Type | Description |
|---|---|---|
| element | Element | HTML element to dispatch the event on |
| name | String | Name of the event, visible in event.type |
| mojoDetails | String | A hash of custom event properties to be copied to the event object |
| optionalBubbles | Boolean | True to set the event propagation to bubble. |
| optionalCancel | Boolean | True to allow the event's default action to be prevented via the preventDefault() method. |
Example usage:
if (event.keyCode === Mojo.Char.enter) {
var selection = document.querySelector(':focus');
if (!Mojo.Gesture.handlesReturnKey(selection)) {
Event.stop(event);
Mojo.Event.sendKeyDownAndUpEvents("U+0009");
}
}







0 Comments