diff options
Diffstat (limited to 'js/src/dom/event-handler.js')
-rw-r--r-- | js/src/dom/event-handler.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/js/src/dom/event-handler.js b/js/src/dom/event-handler.js index 2aa687bb13..e2fdbd52cf 100644 --- a/js/src/dom/event-handler.js +++ b/js/src/dom/event-handler.js @@ -221,13 +221,13 @@ function removeHandler(element, events, typeEvent, handler, delegationSelector) function removeNamespacedHandlers(element, events, typeEvent, namespace) { const storeElementEvent = events[typeEvent] || {} - Object.keys(storeElementEvent).forEach(handlerKey => { + for (const handlerKey of Object.keys(storeElementEvent)) { if (handlerKey.includes(namespace)) { const event = storeElementEvent[handlerKey] removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector) } - }) + } } function getTypeEvent(event) { @@ -266,13 +266,13 @@ const EventHandler = { } if (isNamespace) { - Object.keys(events).forEach(elementEvent => { + for (const elementEvent of Object.keys(events)) { removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1)) - }) + } } const storeElementEvent = events[typeEvent] || {} - Object.keys(storeElementEvent).forEach(keyHandlers => { + for (const keyHandlers of Object.keys(storeElementEvent)) { const handlerKey = keyHandlers.replace(stripUidRegex, '') if (!inNamespace || originalTypeEvent.includes(handlerKey)) { @@ -280,7 +280,7 @@ const EventHandler = { removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector) } - }) + } }, trigger(element, event, args) { @@ -320,13 +320,13 @@ const EventHandler = { // merge custom information in our event if (typeof args !== 'undefined') { - Object.keys(args).forEach(key => { + for (const key of Object.keys(args)) { Object.defineProperty(evt, key, { get() { return args[key] } }) - }) + } } if (defaultPrevented) { |