diff options
Diffstat (limited to 'js/src/dom/event-handler.js')
-rw-r--r-- | js/src/dom/event-handler.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/js/src/dom/event-handler.js b/js/src/dom/event-handler.js index 12b157467c..f4305b6187 100644 --- a/js/src/dom/event-handler.js +++ b/js/src/dom/event-handler.js @@ -289,7 +289,6 @@ const EventHandler = { let bubbles = true let nativeDispatch = true let defaultPrevented = false - let evt = null if (inNamespace && $) { jQueryEvent = $.Event(event, args) @@ -300,12 +299,9 @@ const EventHandler = { defaultPrevented = jQueryEvent.isDefaultPrevented() } - if (isNative) { - evt = document.createEvent('HTMLEvents') - evt.initEvent(typeEvent, bubbles, true) - } else { - evt = new CustomEvent(event, { bubbles, cancelable: true }) - } + const evt = isNative ? + new Event(event, { bubbles, cancelable: true }) : + new CustomEvent(event, { bubbles, cancelable: true }) // merge custom information in our event if (typeof args !== 'undefined') { |