Merge pull request #19556 from Snuffleupagus/_initializeViewerComponents-more-local-vars
Use more local variables in `PDFViewerApplication._initializeViewerComponents`
This commit is contained in:
commit
21829f4157
23
web/app.js
23
web/app.js
@ -380,7 +380,8 @@ const PDFViewerApplication = {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
async _initializeViewerComponents() {
|
async _initializeViewerComponents() {
|
||||||
const { appConfig, externalServices, l10n } = this;
|
const { appConfig, externalServices, l10n, mlManager } = this;
|
||||||
|
const abortSignal = this._globalAbortController.signal;
|
||||||
|
|
||||||
const eventBus =
|
const eventBus =
|
||||||
typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")
|
typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")
|
||||||
@ -391,7 +392,7 @@ const PDFViewerApplication = {
|
|||||||
)
|
)
|
||||||
: new EventBus();
|
: new EventBus();
|
||||||
this.eventBus = AppOptions.eventBus = eventBus;
|
this.eventBus = AppOptions.eventBus = eventBus;
|
||||||
this.mlManager?.setEventBus(eventBus, this._globalAbortController.signal);
|
mlManager?.setEventBus(eventBus, abortSignal);
|
||||||
|
|
||||||
this.overlayManager = new OverlayManager();
|
this.overlayManager = new OverlayManager();
|
||||||
|
|
||||||
@ -470,10 +471,7 @@ const PDFViewerApplication = {
|
|||||||
null,
|
null,
|
||||||
this.overlayManager,
|
this.overlayManager,
|
||||||
l10n,
|
l10n,
|
||||||
externalServices.createSignatureStorage(
|
externalServices.createSignatureStorage(eventBus, abortSignal),
|
||||||
eventBus,
|
|
||||||
this._globalAbortController.signal
|
|
||||||
),
|
|
||||||
eventBus
|
eventBus
|
||||||
)
|
)
|
||||||
: null;
|
: null;
|
||||||
@ -510,8 +508,8 @@ const PDFViewerApplication = {
|
|||||||
enableDetailCanvas: AppOptions.get("enableDetailCanvas"),
|
enableDetailCanvas: AppOptions.get("enableDetailCanvas"),
|
||||||
enablePermissions: AppOptions.get("enablePermissions"),
|
enablePermissions: AppOptions.get("enablePermissions"),
|
||||||
pageColors,
|
pageColors,
|
||||||
mlManager: this.mlManager,
|
mlManager,
|
||||||
abortSignal: this._globalAbortController.signal,
|
abortSignal,
|
||||||
enableHWA,
|
enableHWA,
|
||||||
supportsPinchToZoom: this.supportsPinchToZoom,
|
supportsPinchToZoom: this.supportsPinchToZoom,
|
||||||
enableAutoLinking: AppOptions.get("enableAutoLinking"),
|
enableAutoLinking: AppOptions.get("enableAutoLinking"),
|
||||||
@ -529,7 +527,7 @@ const PDFViewerApplication = {
|
|||||||
renderingQueue: pdfRenderingQueue,
|
renderingQueue: pdfRenderingQueue,
|
||||||
linkService: pdfLinkService,
|
linkService: pdfLinkService,
|
||||||
pageColors,
|
pageColors,
|
||||||
abortSignal: this._globalAbortController.signal,
|
abortSignal,
|
||||||
enableHWA,
|
enableHWA,
|
||||||
});
|
});
|
||||||
pdfRenderingQueue.setThumbnailViewer(this.pdfThumbnailViewer);
|
pdfRenderingQueue.setThumbnailViewer(this.pdfThumbnailViewer);
|
||||||
@ -574,15 +572,12 @@ const PDFViewerApplication = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (mlManager && appConfig.secondaryToolbar?.imageAltTextSettingsButton) {
|
||||||
this.mlManager &&
|
|
||||||
appConfig.secondaryToolbar?.imageAltTextSettingsButton
|
|
||||||
) {
|
|
||||||
this.imageAltTextSettings = new ImageAltTextSettings(
|
this.imageAltTextSettings = new ImageAltTextSettings(
|
||||||
appConfig.altTextSettingsDialog,
|
appConfig.altTextSettingsDialog,
|
||||||
this.overlayManager,
|
this.overlayManager,
|
||||||
eventBus,
|
eventBus,
|
||||||
this.mlManager
|
mlManager
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user