|
|
|
@ -1,9 +1,9 @@
|
|
|
|
|
(function () { |
|
|
|
|
if (typeof window.CustomEvent === "function") return false; // If not IE
|
|
|
|
|
const isIE = () => typeof window.CustomEvent !== "function"; |
|
|
|
|
|
|
|
|
|
function CustomEvent (event, params) { |
|
|
|
|
if (isIE()) { |
|
|
|
|
function CustomEvent(event, params) { |
|
|
|
|
params = params || { bubbles: false, cancelable: false, detail: undefined }; |
|
|
|
|
var evt = document.createEvent("CustomEvent"); |
|
|
|
|
const evt = document.createEvent("CustomEvent"); |
|
|
|
|
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); |
|
|
|
|
|
|
|
|
|
return evt; |
|
|
|
@ -12,4 +12,4 @@
|
|
|
|
|
CustomEvent.prototype = window.Event.prototype; |
|
|
|
|
|
|
|
|
|
window.CustomEvent = CustomEvent; |
|
|
|
|
}()); |
|
|
|
|
} |
|
|
|
|