Merge pull request #14761 from Snuffleupagus/viewer-more-optional-chaining
Use a bit more optional chaining in the viewer
This commit is contained in:
commit
497c0610cd
10
web/app.js
10
web/app.js
@ -2047,9 +2047,8 @@ const PDFViewerApplication = {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_unblockDocumentLoadEvent() {
|
_unblockDocumentLoadEvent() {
|
||||||
if (document.blockUnblockOnload) {
|
document.blockUnblockOnload?.(false);
|
||||||
document.blockUnblockOnload(false);
|
|
||||||
}
|
|
||||||
// Ensure that this method is only ever run once.
|
// Ensure that this method is only ever run once.
|
||||||
this._unblockDocumentLoadEvent = () => {};
|
this._unblockDocumentLoadEvent = () => {};
|
||||||
},
|
},
|
||||||
@ -2112,9 +2111,8 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function loadFakeWorker() {
|
async function loadFakeWorker() {
|
||||||
if (!GlobalWorkerOptions.workerSrc) {
|
GlobalWorkerOptions.workerSrc ||= AppOptions.get("workerSrc");
|
||||||
GlobalWorkerOptions.workerSrc = AppOptions.get("workerSrc");
|
|
||||||
}
|
|
||||||
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION")) {
|
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION")) {
|
||||||
window.pdfjsWorker = await import("pdfjs/core/worker.js");
|
window.pdfjsWorker = await import("pdfjs/core/worker.js");
|
||||||
return;
|
return;
|
||||||
|
@ -243,9 +243,7 @@ function webViewerLoad() {
|
|||||||
|
|
||||||
// Block the "load" event until all pages are loaded, to ensure that printing
|
// Block the "load" event until all pages are loaded, to ensure that printing
|
||||||
// works in Firefox; see https://bugzilla.mozilla.org/show_bug.cgi?id=1618553
|
// works in Firefox; see https://bugzilla.mozilla.org/show_bug.cgi?id=1618553
|
||||||
if (document.blockUnblockOnload) {
|
document.blockUnblockOnload?.(true);
|
||||||
document.blockUnblockOnload(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
document.readyState === "interactive" ||
|
document.readyState === "interactive" ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user