Merge pull request #15504 from Snuffleupagus/rm-stopImmediatePropagation-checks
Use `stopImmediatePropagation` without checking for its existence first
This commit is contained in:
commit
5f65df774f
@ -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…
x
Reference in New Issue
Block a user