Skip to content

Commit d7afb74

Browse files
Merge pull request #10949 from Snuffleupagus/delay-findController-init
Delay initialization of searching, in the viewer, until the first page has rendered
2 parents d66d273 + d3c0f28 commit d7afb74

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

web/base_viewer.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,10 @@ class BaseViewer {
443443
// starts to create the correct size canvas. Wait until one page is
444444
// rendered so we don't tie up too many resources early on.
445445
onePageRenderedCapability.promise.then(() => {
446+
if (this.findController) {
447+
this.findController.setDocument(pdfDocument); // Enable searching.
448+
}
449+
446450
if (pdfDocument.loadingParams['disableAutoFetch']) {
447451
// XXX: Printing is semi-broken with auto fetch disabled.
448452
pagesCapability.resolve();
@@ -471,9 +475,6 @@ class BaseViewer {
471475

472476
this.eventBus.dispatch('pagesinit', { source: this, });
473477

474-
if (this.findController) {
475-
this.findController.setDocument(pdfDocument); // Enable searching.
476-
}
477478
if (this.defaultRenderingQueue) {
478479
this.update();
479480
}

0 commit comments

Comments
 (0)