mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Merge pull request #16295 from Pascal-D/updateDeprecatedCustomEvents
Use CustomEvent when dispatching the "webviewerloaded" event
This commit is contained in:
commit
1503701d9e
1 changed files with 6 additions and 3 deletions
|
@ -179,9 +179,12 @@ function webViewerLoad() {
|
|||
// Give custom implementations of the default viewer a simpler way to
|
||||
// set various `AppOptions`, by dispatching an event once all viewer
|
||||
// files are loaded but *before* the viewer initialization has run.
|
||||
const event = document.createEvent("CustomEvent");
|
||||
event.initCustomEvent("webviewerloaded", true, true, {
|
||||
source: window,
|
||||
const event = new CustomEvent("webviewerloaded", {
|
||||
bubbles: true,
|
||||
cancelable: true,
|
||||
detail: {
|
||||
source: window,
|
||||
},
|
||||
});
|
||||
try {
|
||||
// Attempt to dispatch the event at the embedding `document`,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue