summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/lib/utils/custom_event_polyfill.js.es6
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2016-11-30 14:53:30 +0200
committerValery Sizov <valery@gitlab.com>2016-11-30 14:53:30 +0200
commit32c6c9c457d88071ad82728ea6111a2d7d31b634 (patch)
treefe7f181e05f7268d5cdb177b05d763f5c22c3634 /app/assets/javascripts/lib/utils/custom_event_polyfill.js.es6
parent7a155137a4fd965cb8ff512a9548a7e685b330f5 (diff)
parent43c8788e7bd4c705bc8215ea2409b21a19d090f7 (diff)
downloadgitlab-ce-32c6c9c457d88071ad82728ea6111a2d7d31b634.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into bitbucket-oauth2
Diffstat (limited to 'app/assets/javascripts/lib/utils/custom_event_polyfill.js.es6')
-rw-r--r--app/assets/javascripts/lib/utils/custom_event_polyfill.js.es612
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;
+}