@@ -675,7 +675,7 @@ const inject = {
675
675
title = sources$ [ sources$ . length - 1 ] ;
676
676
}
677
677
cfgs . forEach ( ( cfg , idx1 ) => {
678
- function perform_inject ( ) {
678
+ const perform_inject = ( ) => {
679
679
if ( cfg . target != "none" )
680
680
cfg . $target . each ( ( idx2 , target ) => {
681
681
this . _performInjection (
@@ -687,11 +687,11 @@ const inject = {
687
687
title
688
688
) ;
689
689
} ) ;
690
- }
690
+ } ;
691
691
if ( cfg . processDelay ) {
692
- setTimeout ( ( ) => perform_inject . bind ( this ) ( ) , cfg . processDelay ) ;
692
+ setTimeout ( ( ) => perform_inject ( ) , cfg . processDelay ) ;
693
693
} else {
694
- perform_inject . bind ( this ) ( ) ;
694
+ perform_inject ( ) ;
695
695
}
696
696
} ) ;
697
697
if ( cfgs [ 0 ] . nextHref && $el . is ( "a" ) ) {
@@ -964,15 +964,15 @@ const inject = {
964
964
const $scrollable = $el . parents ( ":scrollable" ) ;
965
965
966
966
// function to trigger the autoload and mark as triggered
967
- function trigger ( event ) {
967
+ const trigger = ( event ) => {
968
968
if ( $el . data ( "pat-inject-autoloaded" ) ) {
969
969
return false ;
970
970
}
971
971
$el . data ( "pat-inject-autoloaded" , true ) ;
972
972
this . onTrigger ( { target : $el [ 0 ] } ) ;
973
973
event && event . preventDefault ( ) ;
974
974
return true ;
975
- }
975
+ } ;
976
976
$el . click ( trigger ) ;
977
977
978
978
// Use case 1: a (heigh-constrained) scrollable parent
@@ -1068,11 +1068,11 @@ const inject = {
1068
1068
const timeout = parseInt ( delay , 10 ) ;
1069
1069
let timer ;
1070
1070
1071
- function onTimeout ( ) {
1071
+ const onTimeout = ( ) => {
1072
1072
this . onTrigger ( { target : $el [ 0 ] } ) ;
1073
1073
unsub ( ) ;
1074
1074
clearTimeout ( timer ) ;
1075
- }
1075
+ } ;
1076
1076
1077
1077
const onInteraction = utils . debounce ( ( ) => {
1078
1078
if ( ! document . body . contains ( $el [ 0 ] ) ) {
@@ -1083,7 +1083,7 @@ const inject = {
1083
1083
timer = setTimeout ( onTimeout , timeout ) ;
1084
1084
} , timeout ) ;
1085
1085
1086
- function unsub ( ) {
1086
+ const unsub = ( ) => {
1087
1087
[ "scroll" , "resize" ] . forEach ( ( e ) =>
1088
1088
window . removeEventListener ( e , onInteraction )
1089
1089
) ;
@@ -1095,7 +1095,7 @@ const inject = {
1095
1095
"touchstart" ,
1096
1096
"touchend" ,
1097
1097
] . forEach ( ( e ) => document . removeEventListener ( e , onInteraction ) ) ;
1098
- }
1098
+ } ;
1099
1099
1100
1100
onInteraction ( ) ;
1101
1101
0 commit comments