Created
March 24, 2014 17:07
-
-
Save chambaz/9744586 to your computer and use it in GitHub Desktop.
Polyfill for CustomEvent() constructor functionality in Internet Explorer 9 and 10
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
(function () { | |
function CustomEvent ( event, params ) { | |
params = params || { bubbles: false, cancelable: false, detail: undefined }; | |
var evt = document.createEvent( 'CustomEvent' ); | |
evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ); | |
return evt; | |
}; | |
CustomEvent.prototype = window.Event.prototype; | |
window.CustomEvent = CustomEvent; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment