Use CustomEvent
when dispatching the "webviewerloaded" event
According to MDN, see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/initCustomEvent, using initCustomEvent() is deprecated.
This commit is contained in:
parent
342dc760da
commit
d9bf571f5c
@ -179,9 +179,12 @@ function webViewerLoad() {
|
|||||||
// Give custom implementations of the default viewer a simpler way to
|
// Give custom implementations of the default viewer a simpler way to
|
||||||
// set various `AppOptions`, by dispatching an event once all viewer
|
// set various `AppOptions`, by dispatching an event once all viewer
|
||||||
// files are loaded but *before* the viewer initialization has run.
|
// files are loaded but *before* the viewer initialization has run.
|
||||||
const event = document.createEvent("CustomEvent");
|
const event = new CustomEvent("webviewerloaded", {
|
||||||
event.initCustomEvent("webviewerloaded", true, true, {
|
bubbles: true,
|
||||||
source: window,
|
cancelable: true,
|
||||||
|
detail: {
|
||||||
|
source: window,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
// Attempt to dispatch the event at the embedding `document`,
|
// Attempt to dispatch the event at the embedding `document`,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user