diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2016-11-23 14:48:01 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2016-11-23 14:48:01 +0000 |
commit | 56d2906293a9edb022449a214258d05e15471f83 (patch) | |
tree | a93003ab47fe8d10d80f2f7dbba7bc9f79f29036 /app | |
parent | 3e0c6142d120538476019c877cf265c9a7f08c74 (diff) | |
download | gitlab-ce-56d2906293a9edb022449a214258d05e15471f83.tar.gz |
Adds polyfill for CustomEventcustom-event-polyfill
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/lib/utils/custom_event_polyfill.js.es6 | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/custom_event_polyfill.js.es6 b/app/assets/javascripts/lib/utils/custom_event_polyfill.js.es6 new file mode 100644 index 00000000000..5ae978010c9 --- /dev/null +++ b/app/assets/javascripts/lib/utils/custom_event_polyfill.js.es6 @@ -0,0 +1,12 @@ +/** + * CustomEvent support for IE + */ +if (typeof window.CustomEvent !== 'function') { + window.CustomEvent = function CustomEvent(e, params) { + const options = params || { bubbles: false, cancelable: false, detail: undefined }; + const evt = document.createEvent('CustomEvent'); + evt.initCustomEvent(e, options.bubbles, options.cancelable, options.detail); + return evt; + }; + window.CustomEvent.prototype = window.Event.prototype; +} |