mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 18:25:37 +02:00
Merge pull request #10949 from Snuffleupagus/delay-findController-init
Delay initialization of searching, in the viewer, until the first page has rendered
This commit is contained in:
commit
d7afb74a6e
1 changed files with 4 additions and 3 deletions
|
@ -443,6 +443,10 @@ class BaseViewer {
|
||||||
// starts to create the correct size canvas. Wait until one page is
|
// starts to create the correct size canvas. Wait until one page is
|
||||||
// rendered so we don't tie up too many resources early on.
|
// rendered so we don't tie up too many resources early on.
|
||||||
onePageRenderedCapability.promise.then(() => {
|
onePageRenderedCapability.promise.then(() => {
|
||||||
|
if (this.findController) {
|
||||||
|
this.findController.setDocument(pdfDocument); // Enable searching.
|
||||||
|
}
|
||||||
|
|
||||||
if (pdfDocument.loadingParams['disableAutoFetch']) {
|
if (pdfDocument.loadingParams['disableAutoFetch']) {
|
||||||
// XXX: Printing is semi-broken with auto fetch disabled.
|
// XXX: Printing is semi-broken with auto fetch disabled.
|
||||||
pagesCapability.resolve();
|
pagesCapability.resolve();
|
||||||
|
@ -471,9 +475,6 @@ class BaseViewer {
|
||||||
|
|
||||||
this.eventBus.dispatch('pagesinit', { source: this, });
|
this.eventBus.dispatch('pagesinit', { source: this, });
|
||||||
|
|
||||||
if (this.findController) {
|
|
||||||
this.findController.setDocument(pdfDocument); // Enable searching.
|
|
||||||
}
|
|
||||||
if (this.defaultRenderingQueue) {
|
if (this.defaultRenderingQueue) {
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue