@@ -416,39 +416,14 @@ const inject = {
416
416
return $target ;
417
417
} ,
418
418
419
- stopBubblingFromRemovedElement ( $el , cfgs , ev ) {
420
- /* IE8 fix. Stop event from propagating IF $el will be removed
421
- * from the DOM. With pat-inject, often $el is the target that
422
- * will itself be replaced with injected content.
423
- *
424
- * IE8 cannot handle events bubbling up from an element removed
425
- * from the DOM.
426
- *
427
- * See: http://stackoverflow.com/questions/7114368/why-is-jquery-remove-throwing-attr-exception-in-ie8
428
- */
429
- for ( const cfg of cfgs ) {
430
- const sel = cfg . target ;
431
- if ( $el . parents ( sel ) . addBack ( sel ) && ! ev . isPropagationStopped ( ) ) {
432
- ev . stopPropagation ( ) ;
433
- return ;
434
- }
435
- }
436
- } ,
437
-
438
419
_performInjection ( target , $el , $source , cfg , trigger , title ) {
439
420
/* Called after the XHR has succeeded and we have a new $source
440
421
* element to inject.
441
422
*/
442
423
if ( cfg . sourceMod === "content" ) {
443
424
$source = $source . contents ( ) ;
444
425
}
445
- let $src ;
446
- // $source.clone() does not work with shived elements in IE8
447
- if ( document . all && document . querySelector && ! document . addEventListener ) {
448
- $src = $source . map ( ( idx , el ) => $ ( el . outerHTML ) [ 0 ] ) ;
449
- } else {
450
- $src = $source . safeClone ( ) ;
451
- }
426
+ const $src = $source . safeClone ( ) ;
452
427
453
428
$src . findInclusive ( "img" ) . on ( "load" , ( e ) => {
454
429
$ ( e . currentTarget ) . trigger ( "pat-inject-content-loaded" ) ;
@@ -491,7 +466,6 @@ const inject = {
491
466
*/
492
467
$injected
493
468
. filter ( ( idx , el_ ) => {
494
- // setting data on textnode fails in IE8
495
469
return el_ . nodeType !== TEXT_NODE ;
496
470
} )
497
471
. data ( "pat-injected" , { origin : cfg . url } ) ;
@@ -591,7 +565,6 @@ const inject = {
591
565
$ . each ( cfgs [ 0 ] . hooks || [ ] , ( idx , hook ) =>
592
566
$el . trigger ( "pat-inject-hook-" + hook )
593
567
) ;
594
- this . stopBubblingFromRemovedElement ( $el , cfgs , ev ) ;
595
568
const sources$ = await this . callTypeHandler ( cfgs [ 0 ] . dataType , "sources" , $el , [
596
569
cfgs ,
597
570
data ,
0 commit comments