From 927b3befbdbff80108f99cc4bdea4de5c999660b Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Tue, 27 Sep 2022 09:43:00 +0200 Subject: [PATCH] breaking: Remove remaining IE support code. --- src/pat/inject/inject.js | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/src/pat/inject/inject.js b/src/pat/inject/inject.js index ee2d3acb0..0d2651bc0 100644 --- a/src/pat/inject/inject.js +++ b/src/pat/inject/inject.js @@ -416,25 +416,6 @@ const inject = { return $target; }, - stopBubblingFromRemovedElement($el, cfgs, ev) { - /* IE8 fix. Stop event from propagating IF $el will be removed - * from the DOM. With pat-inject, often $el is the target that - * will itself be replaced with injected content. - * - * IE8 cannot handle events bubbling up from an element removed - * from the DOM. - * - * See: http://stackoverflow.com/questions/7114368/why-is-jquery-remove-throwing-attr-exception-in-ie8 - */ - for (const cfg of cfgs) { - const sel = cfg.target; - if ($el.parents(sel).addBack(sel) && !ev.isPropagationStopped()) { - ev.stopPropagation(); - return; - } - } - }, - _performInjection(target, $el, $source, cfg, trigger, title) { /* Called after the XHR has succeeded and we have a new $source * element to inject. @@ -442,13 +423,7 @@ const inject = { if (cfg.sourceMod === "content") { $source = $source.contents(); } - let $src; - // $source.clone() does not work with shived elements in IE8 - if (document.all && document.querySelector && !document.addEventListener) { - $src = $source.map((idx, el) => $(el.outerHTML)[0]); - } else { - $src = $source.safeClone(); - } + const $src = $source.safeClone(); $src.findInclusive("img").on("load", (e) => { $(e.currentTarget).trigger("pat-inject-content-loaded"); @@ -491,7 +466,6 @@ const inject = { */ $injected .filter((idx, el_) => { - // setting data on textnode fails in IE8 return el_.nodeType !== TEXT_NODE; }) .data("pat-injected", { origin: cfg.url }); @@ -591,7 +565,6 @@ const inject = { $.each(cfgs[0].hooks || [], (idx, hook) => $el.trigger("pat-inject-hook-" + hook) ); - this.stopBubblingFromRemovedElement($el, cfgs, ev); const sources$ = await this.callTypeHandler(cfgs[0].dataType, "sources", $el, [ cfgs, data,