@@ -465,7 +465,6 @@ function initMouseInteractionObserver({
465
465
let hrefAttr : string | null = null ;
466
466
let src : string | null = null ;
467
467
let targetText : string | null = null ;
468
- let cEmissionEvent = emissionEvent as clickParam ;
469
468
470
469
let sig_target =
471
470
htarget . closest &&
@@ -506,24 +505,24 @@ function initMouseInteractionObserver({
506
505
const image_target = sig_target as HTMLImageElement ;
507
506
src = image_target . src ;
508
507
}
509
- cEmissionEvent = {
510
- ...cEmissionEvent ,
508
+ emissionEvent = {
509
+ ...emissionEvent ,
511
510
...( href && { href } ) ,
512
511
...( hrefAttr && { hrefAttr } ) ,
513
512
...( src && { src } ) ,
514
513
...( targetText && { targetText } ) ,
515
514
targetTagName : htarget . tagName ,
516
515
} ;
517
516
if ( htarget . classList && htarget . classList . length ) {
518
- cEmissionEvent = {
519
- ...cEmissionEvent ,
517
+ emissionEvent = {
518
+ ...emissionEvent ,
520
519
targetClasses : Array . from ( htarget . classList ) ,
521
520
} ;
522
521
}
523
522
524
523
if ( htarget !== sig_target ) {
525
- cEmissionEvent = {
526
- ...cEmissionEvent ,
524
+ emissionEvent = {
525
+ ...emissionEvent ,
527
526
sigTargetTagName : sig_target . tagName ,
528
527
} ;
529
528
}
@@ -540,8 +539,8 @@ function initMouseInteractionObserver({
540
539
if ( htargetBound === null ) {
541
540
htargetBound = ( htarget as Element ) . getBoundingClientRect ( ) ;
542
541
}
543
- cEmissionEvent = {
544
- ...cEmissionEvent ,
542
+ emissionEvent = {
543
+ ...emissionEvent ,
545
544
targetSelector : targetSelector ,
546
545
targetW : Math . round ( 10 * htargetBound . width ) / 10 ,
547
546
targetH : Math . round ( 10 * htargetBound . height ) / 10 ,
@@ -571,8 +570,8 @@ function initMouseInteractionObserver({
571
570
572
571
// TODO: also reject tagNames and ids?
573
572
if ( targetSelector !== altTargetSelector ) {
574
- cEmissionEvent = {
575
- ...cEmissionEvent ,
573
+ emissionEvent = {
574
+ ...emissionEvent ,
576
575
altTargetSelector : altTargetSelector ,
577
576
} ;
578
577
}
@@ -604,8 +603,8 @@ function initMouseInteractionObserver({
604
603
targetSelector !== byIdTargetSelector &&
605
604
byIdTargetSelector !== altTargetSelector
606
605
) {
607
- cEmissionEvent = {
608
- ...cEmissionEvent ,
606
+ emissionEvent = {
607
+ ...emissionEvent ,
609
608
byIdTargetSelector : byIdTargetSelector ,
610
609
} ;
611
610
}
@@ -624,8 +623,8 @@ function initMouseInteractionObserver({
624
623
targetSelector !== structuralTargetSelector &&
625
624
structuralTargetSelector !== altTargetSelector
626
625
) {
627
- cEmissionEvent = {
628
- ...cEmissionEvent ,
626
+ emissionEvent = {
627
+ ...emissionEvent ,
629
628
structuralTargetSelector : structuralTargetSelector ,
630
629
} ;
631
630
}
@@ -638,8 +637,8 @@ function initMouseInteractionObserver({
638
637
className : ( cn ) => ! cn . match ( / [ 0 - 9 ] / ) ,
639
638
} ) ;
640
639
if ( targetSelector !== noNumericTargetSelector ) {
641
- cEmissionEvent = {
642
- ...cEmissionEvent ,
640
+ emissionEvent = {
641
+ ...emissionEvent ,
643
642
noNumericTargetSelector : noNumericTargetSelector ,
644
643
} ;
645
644
}
@@ -664,7 +663,7 @@ function initMouseInteractionObserver({
664
663
others_with_alt . length === 1 &&
665
664
others_with_alt [ 0 ] === htarget
666
665
) {
667
- cEmissionEvent [ attr_name ] = altAttributeSelector ;
666
+ ( emissionEvent as clickParam ) [ attr_name ] = altAttributeSelector ;
668
667
}
669
668
}
670
669
} ) ;
0 commit comments