diff options
Diffstat (limited to 'src/polyfill.js')
-rw-r--r-- | src/polyfill.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/polyfill.js b/src/polyfill.js new file mode 100644 index 0000000..3a3c25c --- /dev/null +++ b/src/polyfill.js @@ -0,0 +1,14 @@ +// Add CustomEvent to IE9 and IE10 +if (typeof CustomEvent !== 'function') { + // Code from: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent + function CustomEvent (event, options) { + options = options || { bubbles: false, cancelable: false, detail: undefined } + var e = document.createEvent('CustomEvent') + e.initCustomEvent(event, options.bubbles, options.cancelable, options.detail) + return e + } + + CustomEvent.prototype = window.Event.prototype + + window.CustomEvent = CustomEvent +}
\ No newline at end of file |