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:
Jonas Jenwald 2015-02-11 13:05:04 +01:00
parent ccf05c7a41
commit 8131440f9e
2 changed files with 4 additions and 2 deletions

View File

@ -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));
}, },

View File

@ -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.