Methods

on ( type, callback, [target ], [useCapture =false] ) Function

Register an callback of a specific event type on the EventTarget. This method is merely an alias to addEventListener.
注册对目标特定事件类型的回调。这种方法仅仅是addEventListener的别名。

type:A string representing the event type to listen for.
一个表示用来侦听事件类型的字符串。

callback:The callback that will be invoked when the event is dispatched. The callback is ignored if it is a duplicate (the callbacks are unique).
当事件被调度时,将调用的回调。如果回调重复,将被忽略.(回调是独一无二的)。

target:The target to invoke the callback, can be null
目标:目标调用的回调,可以是空的.

useCapture:When set to true, the capture argument prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET.
useCapture:设置为true时,事件的eventphase属性值为BUBBLING_PHASE时,捕获参数将防止回调调用。设置为false时,事件的eventphase属性值为CAPTURING_PHASE时,回调将不会被调用。无论哪种方式,事件的eventphase属性值为AT_TARGET时,回调将被调用.

Just returns the incoming callback so you can save the anonymous function easier.
只要返回传入的回调,这样您就可以更容易保存匿名函数.

off ( type, callback, [target ], [useCapture =false] )

Removes the callback previously registered with the same type, callback, target and or useCapture. This method is merely an alias to removeEventListener.
删除以前注册的同类型,回调函数,目标或useCapture的回调。这种方法只是removeEventListener别名。

type: A string representing the event type being removed.
被删除的事件类型的字符串。

callback: The callback to remove.
将被移除的回调。

target:The target to invoke the callback, if it's not given, only callback without target will be removed
要调用这个回调函数的目标,如果未给定,只有没有目标的回调会被移除。

useCapture: Specifies whether the callback being removed was registered as a capturing callback or not. If not specified, useCapture defaults to false. If a callback was registered twice, one with capture and one without, each must be removed separately. Removal of a capturing callback does not affect a non-capturing version of the same listener, and vice versa.
指定被删除的回调是否被注册为一个捕获回调。如果未指定,useCapture默认为false。如果一个回调注册了两次,一个是捕获和一个没有,那么每个回调必须分别被删除。移除捕获回调不会影响同一侦听器的非捕获版本,反之亦然。

targetOff ( target )

Removes all callbacks previously registered with the same target.
删除所有以前注册在同一目标的回调。

once ( type, callback, [target ], [useCapture =false] )

Register an callback of a specific event type on the EventTarget, the callback will remove itself after the first time it is triggered.
注册对目标特定事件类型的回调。回调将在自己第一次触发后被移除。

dispatchEvent ( event ) Boolean

Dispatches an event into the event flow. The event target is the EventTarget object upon which the dispatchEvent() method is called.
分发事件到事件流。事件目标是目标对象的被称为dispatchevent()的方法。

emit ( message, [detail ] )

Send an event to this object directly, this method will not propagate the event to any other objects. The event will be created from the supplied message, you can get the "detail" argument from event.detail.
直接向该对象发送一个事件,该方法将不会将事件传播到任何其他对象。事件将从提供的信息创建,你可以从event.detail得到“细节”的说法。

_isTargetActive ( type ) Boolean

Get whether the target is active for events. The name is for avoiding conflict with user defined functions.
获得目标是否是有效事件。名称是为了避免与用户定义的功能冲突。

Subclasses can override this method to make event target active or inactive.
子类可以重写此方法以使事件目标有效或无效。

_getCapturingTargets ( type, array )

Get all the targets listening to the supplied type of event in the target's capturing phase. The capturing phase comprises the journey from the root to the last node BEFORE the event target's node. The result should save in the array parameter, and MUST SORT from child nodes to parent nodes.
获得所有提供侦听类型事件的目标。【为了不必要的误解,自行翻译理解。】。结果应该保存在数组参数中,并且必须从子节点到父节点排序。

Subclasses can override this method to make event propagable.
子类可以重写此方法以使事件目标有效或无效。

_getBubblingTargets ( type, array )

Get all the targets listening to the supplied type of event in the target's bubbling phase. The bubbling phase comprises any SUBSEQUENT nodes encountered on the return trip to the root of the tree. The result should save in the array parameter, and MUST SORT from child nodes to parent nodes.
获得所有提供侦听类型事件的目标。【为了不必要的误解,自行翻译理解。】结果应该保存在数组参数中,并且必须从子节点到父节点排序

Subclasses can override this method to make event propagable.
子类可以重写此方法以使事件目标有效或无效