debian-mirror-gitlab/app/assets/javascripts/commons/polyfills/custom_event.js
2017-08-17 22:00:37 +05:30

9 lines
406 B
JavaScript

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;
}