Browse Source

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.
Jonas Jenwald 10 years ago
parent
commit
8131440f9e
  1. 4
      web/pdf_viewer.js
  2. 2
      web/viewer.js

4
web/pdf_viewer.js

@ -306,6 +306,10 @@ var PDFViewer = (function pdfViewer() { @@ -306,6 +306,10 @@ var PDFViewer = (function pdfViewer() {
if (this.defaultRenderingQueue) {
this.update();
}
if (this.findController) {
this.findController.resolveFirstPage();
}
}.bind(this));
},

2
web/viewer.js

@ -863,8 +863,6 @@ var PDFViewerApplication = { @@ -863,8 +863,6 @@ var PDFViewerApplication = {
self.loadingBar.setWidth(document.getElementById('viewer'));
self.findController.resolveFirstPage();
if (!PDFJS.disableHistory && !self.isViewerEmbedded) {
// The browsing history is only enabled when the viewer is standalone,
// i.e. not when it is embedded in a web page.

Loading…
Cancel
Save