custom_event.js 437 Bytes
Newer Older
Eric Eastwood's avatar
Eric Eastwood committed
1 2 3 4 5 6 7 8 9 10 11 12
/* global CustomEvent */
/* eslint-disable no-global-assign */

// Custom event support for IE
CustomEvent = function CustomEvent(event, parameters) {
  const params = parameters || { bubbles: false, cancelable: false, detail: undefined };
  const evt = document.createEvent('CustomEvent');
  evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
  return evt;
};

CustomEvent.prototype = window.Event.prototype;