mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Convert the overlay manager to ES6 syntax
This commit is contained in:
parent
8d55e6a01d
commit
e7a04fc82d
6 changed files with 111 additions and 92 deletions
18
web/app.js
18
web/app.js
|
@ -119,6 +119,8 @@ var PDFViewerApplication = {
|
|||
store: null,
|
||||
/** @type {DownloadManager} */
|
||||
downloadManager: null,
|
||||
/** @type {OverlayManager} */
|
||||
overlayManager: null,
|
||||
/** @type {Preferences} */
|
||||
preferences: null,
|
||||
/** @type {Toolbar} */
|
||||
|
@ -261,6 +263,8 @@ var PDFViewerApplication = {
|
|||
let appConfig = this.appConfig;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
this.overlayManager = new OverlayManager();
|
||||
|
||||
let eventBus = appConfig.eventBus || getGlobalEventBus();
|
||||
this.eventBus = eventBus;
|
||||
|
||||
|
@ -329,16 +333,15 @@ var PDFViewerApplication = {
|
|||
|
||||
this.pdfViewer.setFindController(this.findController);
|
||||
|
||||
// FIXME better PDFFindBar constructor parameters
|
||||
// TODO: improve `PDFFindBar` constructor parameter passing
|
||||
let findBarConfig = Object.create(appConfig.findBar);
|
||||
findBarConfig.findController = this.findController;
|
||||
findBarConfig.eventBus = eventBus;
|
||||
this.findBar = new PDFFindBar(findBarConfig);
|
||||
|
||||
this.overlayManager = OverlayManager;
|
||||
|
||||
this.pdfDocumentProperties =
|
||||
new PDFDocumentProperties(appConfig.documentProperties);
|
||||
new PDFDocumentProperties(appConfig.documentProperties,
|
||||
this.overlayManager);
|
||||
|
||||
this.pdfCursorTools = new PDFCursorTools({
|
||||
container,
|
||||
|
@ -361,7 +364,8 @@ var PDFViewerApplication = {
|
|||
});
|
||||
}
|
||||
|
||||
this.passwordPrompt = new PasswordPrompt(appConfig.passwordOverlay);
|
||||
this.passwordPrompt = new PasswordPrompt(appConfig.passwordOverlay,
|
||||
this.overlayManager);
|
||||
|
||||
this.pdfOutlineViewer = new PDFOutlineViewer({
|
||||
container: appConfig.sidebar.outlineView,
|
||||
|
@ -375,7 +379,7 @@ var PDFViewerApplication = {
|
|||
downloadManager,
|
||||
});
|
||||
|
||||
// FIXME better PDFSidebar constructor parameters
|
||||
// TODO: improve `PDFSidebar` constructor parameter passing
|
||||
let sidebarConfig = Object.create(appConfig.sidebar);
|
||||
sidebarConfig.pdfViewer = this.pdfViewer;
|
||||
sidebarConfig.pdfThumbnailViewer = this.pdfThumbnailViewer;
|
||||
|
@ -1911,7 +1915,7 @@ function webViewerClick(evt) {
|
|||
}
|
||||
|
||||
function webViewerKeyDown(evt) {
|
||||
if (OverlayManager.active) {
|
||||
if (PDFViewerApplication.overlayManager.active) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue