Move the setTitleUsingUrl
-call into PDFViewerApplication.initPassiveLoading
This seems overall nicer, rather than having to "manually" call this when initializing passive loading.
This commit is contained in:
parent
73b6ee5325
commit
cae8fe4c7e
@ -768,13 +768,15 @@ const PDFViewerApplication = {
|
|||||||
return this.externalServices.supportedMouseWheelZoomModifierKeys;
|
return this.externalServices.supportedMouseWheelZoomModifierKeys;
|
||||||
},
|
},
|
||||||
|
|
||||||
initPassiveLoading() {
|
initPassiveLoading(file) {
|
||||||
if (
|
if (
|
||||||
typeof PDFJSDev === "undefined" ||
|
typeof PDFJSDev === "undefined" ||
|
||||||
!PDFJSDev.test("MOZCENTRAL || CHROME")
|
!PDFJSDev.test("MOZCENTRAL || CHROME")
|
||||||
) {
|
) {
|
||||||
throw new Error("Not implemented: initPassiveLoading");
|
throw new Error("Not implemented: initPassiveLoading");
|
||||||
}
|
}
|
||||||
|
this.setTitleUsingUrl(file, /* downloadUrl = */ file);
|
||||||
|
|
||||||
this.externalServices.initPassiveLoading({
|
this.externalServices.initPassiveLoading({
|
||||||
onOpenWithTransport: range => {
|
onOpenWithTransport: range => {
|
||||||
this.open({ range });
|
this.open({ range });
|
||||||
@ -2285,8 +2287,7 @@ function webViewerInitialized() {
|
|||||||
PDFViewerApplication._hideViewBookmark();
|
PDFViewerApplication._hideViewBookmark();
|
||||||
}
|
}
|
||||||
} else if (PDFJSDev.test("MOZCENTRAL || CHROME")) {
|
} else if (PDFJSDev.test("MOZCENTRAL || CHROME")) {
|
||||||
PDFViewerApplication.setTitleUsingUrl(file, /* downloadUrl = */ file);
|
PDFViewerApplication.initPassiveLoading(file);
|
||||||
PDFViewerApplication.initPassiveLoading();
|
|
||||||
} else {
|
} else {
|
||||||
throw new Error("Not implemented: webViewerInitialized");
|
throw new Error("Not implemented: webViewerInitialized");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user