Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
47242cd0
Commit
47242cd0
authored
7 years ago
by
Johann-S
Committed by
XhmikosR
6 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Fix delegation events
parent
7d7873b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/src/dom/eventHandler.js
+4
-3
js/src/dom/eventHandler.js
with
4 additions
and
3 deletions
+4
-3
js/src/dom/eventHandler.js
+
4
-
3
View file @
47242cd0
...
...
@@ -115,7 +115,8 @@ const EventHandler = {
return
}
const
delegation
=
typeof
handler
===
'
string
'
const
delegation
=
typeof
handler
===
'
string
'
const
originalHandler
=
delegation
?
delegationFn
:
handler
// allow to get the native events from namespaced events ('click.bs.button' --> 'click')
let
typeEvent
=
originalTypeEvent
.
replace
(
stripNameRegex
,
''
)
const
isNative
=
nativeEvents
.
indexOf
(
typeEvent
)
>
-
1
...
...
@@ -124,14 +125,14 @@ const EventHandler = {
}
const
events
=
getEvent
(
element
)
const
handlers
=
events
[
typeEvent
]
||
(
events
[
typeEvent
]
=
{})
const
uid
=
getUidEvent
(
h
andler
,
originalTypeEvent
.
replace
(
namespaceRegex
,
''
))
const
uid
=
getUidEvent
(
originalH
andler
,
originalTypeEvent
.
replace
(
namespaceRegex
,
''
))
if
(
handlers
[
uid
])
{
return
}
const
fn
=
!
delegation
?
bootstrapHandler
(
element
,
handler
)
:
bootstrapDelegationHandler
(
handler
,
delegationFn
)
handlers
[
uid
]
=
fn
h
andler
.
uidEvent
=
uid
originalH
andler
.
uidEvent
=
uid
element
.
addEventListener
(
typeEvent
,
fn
,
false
)
},
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment