mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +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];
|
let eventListeners = this._listeners[eventName];
|
||||||
if (!eventListeners || eventListeners.length === 0) {
|
if (!eventListeners || eventListeners.length === 0) {
|
||||||
if (this._dispatchToDOM) {
|
if (this._dispatchToDOM) {
|
||||||
this._dispatchDOMEvent(eventName);
|
const args = Array.prototype.slice.call(arguments, 1);
|
||||||
|
this._dispatchDOMEvent(eventName, args);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Passing all arguments after the eventName to the listeners.
|
// 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
|
// Making copy of the listeners array in case if it will be modified
|
||||||
// during dispatch.
|
// during dispatch.
|
||||||
eventListeners.slice(0).forEach(function (listener) {
|
eventListeners.slice(0).forEach(function (listener) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue