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.activeElementproperty 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 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 typestring The event type to listen for.
listenerobject | function The listener object or function.
useCaptureboolean 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 eventEvent 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 typestring The type of the event to dispatch
canBubbleboolean Whether or not the event can bubble
cancelableboolean Whether or not the event can be cancelled
detailObject The optional detail object of the event
-
removeEventListener(type, listener, useCapture) source
-
Removes an event listener from the object.
Parameters:
Name Type Description typestring The event type.
listenerobject | function The listener object or function.
useCaptureboolean The phase of the event listener.
-
surrendersActiveTarget(newTarget) → {boolean} source
-
Ask this target to surrender its activeTarget status.
Parameters:
Name Type Description newTargetTarget the Target that is about to become the
activeTargetReturns: boolean
Whether or not to surrender activeTarget status
-
willBecomeActiveTarget(oldTarget) source
-
Called prior to this target becoming the activeTarget
Parameters:
Name Type Description oldTargetTarget the current activeTarget
Generated from a4679af