Target source
A Target is any object that can be a candidate for dispatching and receiving events throughout what is typically considered the "component tree" of a Montage application.
Properties
-
acceptsActiveTarget :boolean source
-
Whether or not this target can accept user focus and become the activeTarget This matches up with the
document.activeElement
property purpose-wise; Events from components that should be dispatched as logically occurring at the point of user focus should be dispatched at the activeTargetBy default a target does not accept this responsibility.
Default Value: - false
-
isActiveTarget :boolean <readonly> source
-
Whether or not this is the activeTarget
This is a getter and is not bindable. Bind to
defaultEventManager.activeTarget == this
. -
nextTarget :Component source
-
Which target to distribute an event after this when distributing events throughout a graph of targets.
Methods
-
addEventListener(type, listener, useCapture) source
-
Adds an event listener to the object.
Parameters:
Name Type Description type
string The event type to listen for.
listener
object | function The listener object or function.
useCapture
boolean Specifies whether to listen for the event during the bubble or capture phases.
-
didBecomeActiveTarget() source
-
Called after to this target became the activeTarget
-
dispatchEvent(event) source
-
Dispatches the specified event with this target as the event's proximal target
Parameters:
Name Type Description event
Event The event object to dispatch
-
dispatchEventNamed(type, canBubble, cancelable, detail) source
-
Creates and dispatches an event with the specified properties with this target as the event's proximal target
Parameters:
Name Type Description type
string The type of the event to dispatch
canBubble
boolean Whether or not the event can bubble
cancelable
boolean Whether or not the event can be cancelled
detail
Object The optional detail object of the event
-
removeEventListener(type, listener, useCapture) source
-
Removes an event listener from the object.
Parameters:
Name Type Description type
string The event type.
listener
object | function The listener object or function.
useCapture
boolean The phase of the event listener.
-
surrendersActiveTarget(newTarget) → {boolean} source
-
Ask this target to surrender its activeTarget status.
Parameters:
Name Type Description newTarget
Target the Target that is about to become the
activeTarget
Returns: boolean
Whether or not to surrender activeTarget status
-
willBecomeActiveTarget(oldTarget) source
-
Called prior to this target becoming the activeTarget
Parameters:
Name Type Description oldTarget
Target the current activeTarget
Generated from v0.14.14