summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-11-04 10:35:35 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-12-21 17:34:40 +0000
commitc84656bb72258e7c69876ba42d965fa31fffbf4d (patch)
tree51d669126bff5f28f3e1cc5e2d15137633923548
parentea823cc899c450e04eacc0e9480733b76c0e2e21 (diff)
downloadgitlab-ce-c84656bb72258e7c69876ba42d965fa31fffbf4d.tar.gz
Fix polyfill
-rw-r--r--app/assets/javascripts/lib/utils/customevent_polyfill.js.es617
1 files changed, 9 insertions, 8 deletions
diff --git a/app/assets/javascripts/lib/utils/customevent_polyfill.js.es6 b/app/assets/javascripts/lib/utils/customevent_polyfill.js.es6
index 416edb674dd..740f063dd76 100644
--- a/app/assets/javascripts/lib/utils/customevent_polyfill.js.es6
+++ b/app/assets/javascripts/lib/utils/customevent_polyfill.js.es6
@@ -1,11 +1,12 @@
/**
* 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;
+if (typeof window.CustomEvent !== 'function') {
+ 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.Event.prototype;
+}