Merge pull request #10996 from Snuffleupagus/app-conditional-findbar

Avoid creating a `PDFFindBar` instance, in the Firefox built-in viewer, when not actually necessary
This commit is contained in:
Tim van der Meij 2019-07-23 22:22:31 +02:00 committed by GitHub
commit e066db47dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -352,7 +352,9 @@ let PDFViewerApplication = {
});
pdfLinkService.setHistory(this.pdfHistory);
this.findBar = new PDFFindBar(appConfig.findBar, eventBus, this.l10n);
if (!this.supportsIntegratedFind) {
this.findBar = new PDFFindBar(appConfig.findBar, eventBus, this.l10n);
}
this.pdfDocumentProperties =
new PDFDocumentProperties(appConfig.documentProperties,
@ -598,7 +600,9 @@ let PDFViewerApplication = {
this.pdfOutlineViewer.reset();
this.pdfAttachmentViewer.reset();
this.findBar.reset();
if (this.findBar) {
this.findBar.reset();
}
this.toolbar.reset();
this.secondaryToolbar.reset();