Class: EventArgs

barejs.EventArgs(_cancelableopt)

Base class for event arguments. Mimics html events cancelable behavior for events that have default behavior that can be canceled. Subclasses can set the cancelable flag on their prototype, or use EventArgs.call( this, true ) to propagate the cancelable flag.

Constructor

new EventArgs(_cancelableopt)

Create new EventArgs. Allows specifying a cancelable parameter as optional argument, which defaults to false.

Parameters:
Name Type Attributes Description
_cancelable boolean <optional>

Optional: provide a boolean to set whether this event is cancelable (default: prototype value, which is false for EventArgs).

Source:

Members

(readonly) cancelable :boolean

The cancelable flag determines whether this event has behavior that can be canceled.

Type:
  • boolean
Source:

(readonly) defaultPrevented :boolean

This value is true if the event got canceled (preventDefault was called, and cancelable is true).

Type:
  • boolean
Source:

Methods

preventDefault()

The preventDefault method will flag the EventArgs as defaultPrevented, if cancelable is true.

Source: