diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-09-11 14:34:16 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-09-11 14:34:16 +0000 |
commit | d329cf4f02bf3a2db00a769c7836410b2e364079 (patch) | |
tree | 0ec17344cb18954e9a84e9aefe0e19faa1cd34e6 /app/assets/javascripts/commons/polyfills/custom_event.js | |
parent | f9b30c6d7ea0aa0ed60a7fdf94273b4b3c24f6fc (diff) | |
download | gitlab-ce-d329cf4f02bf3a2db00a769c7836410b2e364079.tar.gz |
Adds Event polyfill for IE
Diffstat (limited to 'app/assets/javascripts/commons/polyfills/custom_event.js')
-rw-r--r-- | app/assets/javascripts/commons/polyfills/custom_event.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/assets/javascripts/commons/polyfills/custom_event.js b/app/assets/javascripts/commons/polyfills/custom_event.js index aea61b82d03..db51ade61ae 100644 --- a/app/assets/javascripts/commons/polyfills/custom_event.js +++ b/app/assets/javascripts/commons/polyfills/custom_event.js @@ -1,7 +1,12 @@ if (typeof window.CustomEvent !== 'function') { window.CustomEvent = function CustomEvent(event, params) { const evt = document.createEvent('CustomEvent'); - const evtParams = params || { bubbles: false, cancelable: false, detail: undefined }; + const evtParams = { + bubbles: false, + cancelable: false, + detail: undefined, + ...params, + }; evt.initCustomEvent(event, evtParams.bubbles, evtParams.cancelable, evtParams.detail); return evt; }; |