Last active
August 9, 2018 15:27
-
-
Save dmitriybevz2/33396285d26b71600ec36f65d9e21a80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
new CustomEvent("IE has CustomEvent, but doesn't support constructor"); | |
} catch (e) { | |
window.CustomEvent = function(event, params) { | |
var evt; | |
params = params || { | |
bubbles: false, | |
cancelable: false, | |
detail: undefined | |
}; | |
evt = document.createEvent("CustomEvent"); | |
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); | |
return evt; | |
}; | |
CustomEvent.prototype = Object.create(window.Event.prototype); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment