mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-07 06:06:47 +02:00
Event handler: replace deprecated initEvent
This commit is contained in:
@@ -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') {
|
||||
|
Reference in New Issue
Block a user