www.webOShelp.net

Get the latest on:webOS Developers' RSS FeedwebOS Facebook page webOS Twitter Feed

Home Resources API Reference Mojo.Event.make(name{string}, details, optionalDocument, optionalBubbles, optionalCancel)

Mojo.Event.make(name{string}, details, optionalDocument, optionalBubbles, optionalCancel)

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

    Add Comment


      • >:o
      • :-[
      • :'(
      • :-(
      • :-D
      • :-*
      • :-)
      • :P
      • :\
      • 8-)
      • ;-)