summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/commons/polyfills/custom_event.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/commons/polyfills/custom_event.js')
-rw-r--r--app/assets/javascripts/commons/polyfills/custom_event.js7
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;
};