@@ -416,25 +416,6 @@ const inject = {
416416 return $target ;
417417 } ,
418418
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-
438419 _performInjection ( target , $el , $source , cfg , trigger , title ) {
439420 /* Called after the XHR has succeeded and we have a new $source
440421 * element to inject.
@@ -443,13 +424,7 @@ const inject = {
443424 $source = $source . contents ( ) ;
444425 }
445426 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- }
452-
427+ $src = $source . safeClone ( ) ;
453428 $src . findInclusive ( "img" ) . on ( "load" , ( e ) => {
454429 $ ( e . currentTarget ) . trigger ( "pat-inject-content-loaded" ) ;
455430 } ) ;
@@ -491,7 +466,6 @@ const inject = {
491466 */
492467 $injected
493468 . filter ( ( idx , el_ ) => {
494- // setting data on textnode fails in IE8
495469 return el_ . nodeType !== TEXT_NODE ;
496470 } )
497471 . data ( "pat-injected" , { origin : cfg . url } ) ;
@@ -591,7 +565,6 @@ const inject = {
591565 $ . each ( cfgs [ 0 ] . hooks || [ ] , ( idx , hook ) =>
592566 $el . trigger ( "pat-inject-hook-" + hook )
593567 ) ;
594- this . stopBubblingFromRemovedElement ( $el , cfgs , ev ) ;
595568 const sources$ = await this . callTypeHandler ( cfgs [ 0 ] . dataType , "sources" , $el , [
596569 cfgs ,
597570 data ,
@@ -973,15 +946,6 @@ const inject = {
973946 }
974947 }
975948
976- // XXX: IE8 changes the order of attributes in html. The following
977- // lines move data-pat-inject-rebase-src to src.
978- $page . find ( "[data-pat-inject-rebase-src]" ) . each ( ( id , el_ ) => {
979- const $el = $ ( el_ ) ;
980- $el . attr ( "src" , $el . attr ( "data-pat-inject-rebase-src" ) ) . removeAttr (
981- "data-pat-inject-rebase-src"
982- ) ;
983- } ) ;
984-
985949 return $page
986950 . html ( )
987951 . replace ( / s r c = " " d a t a - p a t - i n j e c t - r e b a s e - / g, "" )
0 commit comments