1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

Merge pull request #18831 from Snuffleupagus/toolbar-container

Fix `toolbarViewer`/`toolbarContainer` regressions (PR 18385, 18786 follow-up)
This commit is contained in:
Jonas Jenwald 2024-10-02 09:37:12 +02:00 committed by GitHub
commit e25832c43f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 32 additions and 15 deletions

View file

@ -376,18 +376,16 @@ const PDFViewerApplication = {
async _initializeViewerComponents() {
const { appConfig, externalServices, l10n } = this;
let eventBus;
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
eventBus = AppOptions.eventBus = new FirefoxEventBus(
AppOptions.get("allowedGlobalEvents"),
externalServices,
AppOptions.get("isInAutomation")
);
} else {
eventBus = new EventBus();
}
const eventBus =
typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")
? new FirefoxEventBus(
AppOptions.get("allowedGlobalEvents"),
externalServices,
AppOptions.get("isInAutomation")
)
: new EventBus();
this.eventBus = AppOptions.eventBus = eventBus;
this.mlManager?.setEventBus(eventBus, this._globalAbortController.signal);
this.eventBus = eventBus;
this.overlayManager = new OverlayManager();
@ -876,6 +874,7 @@ const PDFViewerApplication = {
moveCaret(isUp, select) {
this._caretBrowsing ||= new CaretBrowsingMode(
this._globalAbortController.signal,
this.appConfig.mainContainer,
this.appConfig.viewerContainer,
this.appConfig.toolbar?.container