1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-19 10:54:16 +02:00

Refactor on function in utils/events.js

This commit is contained in:
Ahmed Saber 2023-07-15 02:52:28 +03:00
parent 9ed2e0a524
commit df64c8a3ee

View File

@ -305,12 +305,11 @@ export function on(elem, type, fn) {
for (let m = 0, n = handlersCopy.length; m < n; m++) {
if (event.isImmediatePropagationStopped()) {
break;
} else {
try {
handlersCopy[m].call(elem, event, hash);
} catch (e) {
log.error(e);
}
}
try {
handlersCopy[m].call(elem, event, hash);
} catch (e) {
log.error(e);
}
}
}