summaryrefslogtreecommitdiffstats
path: root/src/polyfill.js
blob: 3a3c25c5278e64a72879e6655f6eab1305c83f85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
}