diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2016-11-04 10:35:35 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2016-12-21 17:34:40 +0000 |
commit | c84656bb72258e7c69876ba42d965fa31fffbf4d (patch) | |
tree | 51d669126bff5f28f3e1cc5e2d15137633923548 | |
parent | ea823cc899c450e04eacc0e9480733b76c0e2e21 (diff) | |
download | gitlab-ce-c84656bb72258e7c69876ba42d965fa31fffbf4d.tar.gz |
Fix polyfill
-rw-r--r-- | app/assets/javascripts/lib/utils/customevent_polyfill.js.es6 | 17 |
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; +} |