summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-11-23 14:48:01 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-11-23 14:48:01 +0000
commit56d2906293a9edb022449a214258d05e15471f83 (patch)
treea93003ab47fe8d10d80f2f7dbba7bc9f79f29036
parent3e0c6142d120538476019c877cf265c9a7f08c74 (diff)
downloadgitlab-ce-custom-event-polyfill.tar.gz
Adds polyfill for CustomEventcustom-event-polyfill
-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;
+}