diff options
Diffstat (limited to 'app/assets/javascripts/lib/utils/customevent_polyfill.js.es6')
-rw-r--r-- | app/assets/javascripts/lib/utils/customevent_polyfill.js.es6 | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/customevent_polyfill.js.es6 b/app/assets/javascripts/lib/utils/customevent_polyfill.js.es6 new file mode 100644 index 00000000000..416edb674dd --- /dev/null +++ b/app/assets/javascripts/lib/utils/customevent_polyfill.js.es6 @@ -0,0 +1,11 @@ +/** + * CustomEvent support for IE + */ +window.CustomEvent = window.CustomEvent || function CustomEvent(event, params) { + const options = params || { bubbles: false, cancelable: false, detail: undefined }; + const evt = document.createEvent('CustomEvent'); + evt.initCustomEvent(event, options.bubbles, options.cancelable, options.detail); + return evt; +}; + +window.CustomEvent.prototype = window.CustomEvent.prototype || window.Event.prototype; |