@@ -280,7 +280,7 @@ export class DOMEvent implements Event {
280
280
private resetForRedispatch ( ) {
281
281
this . currentTarget = null ;
282
282
this . target = null ;
283
- this . eventPhase = this . NONE ;
283
+ this . eventPhase = DOMEvent . NONE ;
284
284
this . propagationState = EventPropagationState . resume ;
285
285
this . listenersLive = emptyArray ;
286
286
this . listenersLazyCopy = emptyArray ;
@@ -291,10 +291,10 @@ export class DOMEvent implements Event {
291
291
* method was not invoked, and false otherwise.
292
292
*/
293
293
dispatchTo ( { target, data, getGlobalEventHandlersPreHandling, getGlobalEventHandlersPostHandling } : { target : Observable ; data : EventData ; getGlobalEventHandlersPreHandling ?: ( ) => MutationSensitiveArray < ListenerEntry > ; getGlobalEventHandlersPostHandling ?: ( ) => MutationSensitiveArray < ListenerEntry > } ) : boolean {
294
- if ( this . eventPhase !== this . NONE ) {
294
+ if ( this . eventPhase !== DOMEvent . NONE ) {
295
295
throw new Error ( 'Tried to dispatch a dispatching event' ) ;
296
296
}
297
- this . eventPhase = this . CAPTURING_PHASE ;
297
+ this . eventPhase = DOMEvent . CAPTURING_PHASE ;
298
298
this . target = target ;
299
299
this . defaultPrevented = false ;
300
300
@@ -332,7 +332,7 @@ export class DOMEvent implements Event {
332
332
// possible.
333
333
334
334
this . listenersLazyCopy = this . listenersLive = getGlobalEventHandlersPreHandling ?.( ) || emptyArray ;
335
- this . handleEvent ( data , true , this . CAPTURING_PHASE , removeGlobalEventListener , target . constructor ) ;
335
+ this . handleEvent ( data , true , DOMEvent . CAPTURING_PHASE , removeGlobalEventListener , target . constructor ) ;
336
336
337
337
const eventPath = this . getEventPath ( target , 'capture' ) ;
338
338
@@ -342,10 +342,10 @@ export class DOMEvent implements Event {
342
342
for ( let i = 0 ; i < eventPath . length ; i ++ ) {
343
343
const currentTarget = eventPath [ i ] ;
344
344
this . currentTarget = currentTarget ;
345
- this . eventPhase = this . target === this . currentTarget ? this . AT_TARGET : this . CAPTURING_PHASE ;
345
+ this . eventPhase = this . target === this . currentTarget ? DOMEvent . AT_TARGET : DOMEvent . CAPTURING_PHASE ;
346
346
347
347
this . listenersLazyCopy = this . listenersLive = currentTarget . getEventList ( this . type ) || emptyArray ;
348
- this . handleEvent ( data , false , this . CAPTURING_PHASE , currentTarget . removeEventListener , currentTarget ) ;
348
+ this . handleEvent ( data , false , DOMEvent . CAPTURING_PHASE , currentTarget . removeEventListener , currentTarget ) ;
349
349
350
350
if ( this . propagationState !== EventPropagationState . resume ) {
351
351
this . resetForRedispatch ( ) ;
@@ -357,10 +357,10 @@ export class DOMEvent implements Event {
357
357
// It's correct to dispatch the event to the target during both phases.
358
358
for ( let i = eventPath . length - 1 ; i >= 0 ; i -- ) {
359
359
const currentTarget = eventPath [ i ] ;
360
- this . eventPhase = this . target === this . currentTarget ? this . AT_TARGET : this . BUBBLING_PHASE ;
360
+ this . eventPhase = this . target === this . currentTarget ? DOMEvent . AT_TARGET : DOMEvent . BUBBLING_PHASE ;
361
361
362
362
this . listenersLazyCopy = this . listenersLive = currentTarget . getEventList ( this . type ) || emptyArray ;
363
- this . handleEvent ( data , false , this . BUBBLING_PHASE , currentTarget . removeEventListener , currentTarget ) ;
363
+ this . handleEvent ( data , false , DOMEvent . BUBBLING_PHASE , currentTarget . removeEventListener , currentTarget ) ;
364
364
365
365
if ( this . propagationState !== EventPropagationState . resume ) {
366
366
this . resetForRedispatch ( ) ;
@@ -377,11 +377,11 @@ export class DOMEvent implements Event {
377
377
378
378
// Restore event phase in case it changed to AT_TARGET during
379
379
// this.handleEvent().
380
- this . eventPhase = this . BUBBLING_PHASE ;
380
+ this . eventPhase = DOMEvent . BUBBLING_PHASE ;
381
381
}
382
382
383
383
this . listenersLazyCopy = this . listenersLive = getGlobalEventHandlersPostHandling ?.( ) || emptyArray ;
384
- this . handleEvent ( data , true , this . BUBBLING_PHASE , removeGlobalEventListener , target . constructor ) ;
384
+ this . handleEvent ( data , true , DOMEvent . BUBBLING_PHASE , removeGlobalEventListener , target . constructor ) ;
385
385
386
386
this . resetForRedispatch ( ) ;
387
387
return ! this . defaultPrevented ;
@@ -417,7 +417,7 @@ export class DOMEvent implements Event {
417
417
// Handle only the events appropriate to the phase. Global events
418
418
// (a NativeScript-only concept) are allowed to be handled
419
419
// regardless of phase, for backwards-compatibility.
420
- if ( ! isGlobal && ( ( phase === this . CAPTURING_PHASE && ! capture ) || ( phase === this . BUBBLING_PHASE && capture ) ) ) {
420
+ if ( ! isGlobal && ( ( phase === DOMEvent . CAPTURING_PHASE && ! capture ) || ( phase === DOMEvent . BUBBLING_PHASE && capture ) ) ) {
421
421
continue ;
422
422
}
423
423
0 commit comments