Skip to content

Commit 927b3be

Browse files
committed
breaking: Remove remaining IE support code.
1 parent 72c393a commit 927b3be

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

src/pat/inject/inject.js

+1-28
Original file line numberDiff line numberDiff line change
@@ -416,39 +416,14 @@ 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.
441422
*/
442423
if (cfg.sourceMod === "content") {
443424
$source = $source.contents();
444425
}
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();
452427

453428
$src.findInclusive("img").on("load", (e) => {
454429
$(e.currentTarget).trigger("pat-inject-content-loaded");
@@ -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,

0 commit comments

Comments
 (0)