mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Ensure that all event properties are included, even if no (internal) listeners are registered, when re-dispatching events to the DOM (PR 10019 follow-up)
This commit is contained in:
parent
0e41eb1620
commit
250e55b0d9
1 changed files with 3 additions and 2 deletions
|
@ -708,12 +708,13 @@ class EventBus {
|
|||
let eventListeners = this._listeners[eventName];
|
||||
if (!eventListeners || eventListeners.length === 0) {
|
||||
if (this._dispatchToDOM) {
|
||||
this._dispatchDOMEvent(eventName);
|
||||
const args = Array.prototype.slice.call(arguments, 1);
|
||||
this._dispatchDOMEvent(eventName, args);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Passing all arguments after the eventName to the listeners.
|
||||
let args = Array.prototype.slice.call(arguments, 1);
|
||||
const args = Array.prototype.slice.call(arguments, 1);
|
||||
// Making copy of the listeners array in case if it will be modified
|
||||
// during dispatch.
|
||||
eventListeners.slice(0).forEach(function (listener) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue