mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-01 13:24:25 +01:00
Event-handler: use Array.find
instead of for
This commit is contained in:
parent
fc7c5fcb7a
commit
a1e924c4da
@ -125,15 +125,8 @@ function bootstrapDelegationHandler(element, selector, fn) {
|
||||
}
|
||||
|
||||
function findHandler(events, handler, delegationSelector = null) {
|
||||
for (const uidEvent of Object.keys(events)) {
|
||||
const event = events[uidEvent]
|
||||
|
||||
if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {
|
||||
return event
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
return Object.values(events)
|
||||
.find(event => event.originalHandler === handler && event.delegationSelector === delegationSelector)
|
||||
}
|
||||
|
||||
function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
|
||||
|
Loading…
Reference in New Issue
Block a user