Move the call to |PDFFindController.resolveFirstPage| into PDFViewer
From reading IRC scrollback, it became clear that having to manually call `PDFFindController.resolveFirstPage` in order for the find functionality to work isn't particulary good. Hence this PR, which moves that code into `PDFViewer.setDocument` to make life easier for third-party implementations.
This commit is contained in:
parent
ccf05c7a41
commit
8131440f9e
@ -306,6 +306,10 @@ var PDFViewer = (function pdfViewer() {
|
|||||||
if (this.defaultRenderingQueue) {
|
if (this.defaultRenderingQueue) {
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.findController) {
|
||||||
|
this.findController.resolveFirstPage();
|
||||||
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -863,8 +863,6 @@ var PDFViewerApplication = {
|
|||||||
|
|
||||||
self.loadingBar.setWidth(document.getElementById('viewer'));
|
self.loadingBar.setWidth(document.getElementById('viewer'));
|
||||||
|
|
||||||
self.findController.resolveFirstPage();
|
|
||||||
|
|
||||||
if (!PDFJS.disableHistory && !self.isViewerEmbedded) {
|
if (!PDFJS.disableHistory && !self.isViewerEmbedded) {
|
||||||
// The browsing history is only enabled when the viewer is standalone,
|
// The browsing history is only enabled when the viewer is standalone,
|
||||||
// i.e. not when it is embedded in a web page.
|
// i.e. not when it is embedded in a web page.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user