[Pkg-javascript-commits] [pdf.js] 05/72: Move the call to |PDFFindController.resolveFirstPage| into PDFViewer

David Prévot taffit at moszumanska.debian.org
Wed Mar 18 20:15:54 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 8131440f9eb314a75cbec05fc547903c1f3fd29c
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Wed Feb 11 13:05:04 2015 +0100

    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.
---
 web/pdf_viewer.js | 4 ++++
 web/viewer.js     | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/web/pdf_viewer.js b/web/pdf_viewer.js
index 6e2acd3..dd3873b 100644
--- a/web/pdf_viewer.js
+++ b/web/pdf_viewer.js
@@ -306,6 +306,10 @@ var PDFViewer = (function pdfViewer() {
         if (this.defaultRenderingQueue) {
           this.update();
         }
+
+        if (this.findController) {
+          this.findController.resolveFirstPage();
+        }
       }.bind(this));
     },
 
diff --git a/web/viewer.js b/web/viewer.js
index d8b62d1..bb0ab16 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -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.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list