summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/commons/polyfills/custom_event.js
blob: aea61b82d03b3105b7970c97ca630000e07cfeb7 (plain)
1
2
3
4
5
6
7
8
9
if (typeof window.CustomEvent !== 'function') {
  window.CustomEvent = function CustomEvent(event, params) {
    const evt = document.createEvent('CustomEvent');
    const evtParams = params || { bubbles: false, cancelable: false, detail: undefined };
    evt.initCustomEvent(event, evtParams.bubbles, evtParams.cancelable, evtParams.detail);
    return evt;
  };
  window.CustomEvent.prototype = Event;
}