Use stopImmediatePropagation
without checking for its existence first
These checks were added years ago, but given the following compatibility data we should just be able to call the method directly: https://developer.mozilla.org/en-US/docs/Web/API/Event/stopImmediatePropagation#browser_compatibility
This commit is contained in:
parent
907ef467ea
commit
b420f0165a
@ -314,14 +314,8 @@ window.addEventListener(
|
|||||||
) {
|
) {
|
||||||
window.print();
|
window.print();
|
||||||
|
|
||||||
// The (browser) print dialog cannot be prevented from being shown in
|
|
||||||
// IE11.
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (event.stopImmediatePropagation) {
|
event.stopImmediatePropagation();
|
||||||
event.stopImmediatePropagation();
|
|
||||||
} else {
|
|
||||||
event.stopPropagation();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
true
|
true
|
||||||
@ -331,7 +325,7 @@ if ("onbeforeprint" in window) {
|
|||||||
// Do not propagate before/afterprint events when they are not triggered
|
// Do not propagate before/afterprint events when they are not triggered
|
||||||
// from within this polyfill. (FF / Chrome 63+).
|
// from within this polyfill. (FF / Chrome 63+).
|
||||||
const stopPropagationIfNeeded = function (event) {
|
const stopPropagationIfNeeded = function (event) {
|
||||||
if (event.detail !== "custom" && event.stopImmediatePropagation) {
|
if (event.detail !== "custom") {
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user