[Pkg-javascript-commits] [pdf.js] 116/210: Reduce the number of calls to PDFView.getVisiblePages from updateViewarea

David Prévot taffit at moszumanska.debian.org
Thu Jun 5 14:21:08 UTC 2014


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

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

commit b88c5330a9f9b1c5f284a9f100ec9f6f2f48ab89
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Fri May 9 16:08:19 2014 +0200

    Reduce the number of calls to PDFView.getVisiblePages from updateViewarea
---
 web/viewer.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/web/viewer.js b/web/viewer.js
index 755d54b..b9fad00 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -1205,14 +1205,15 @@ var PDFView = {
     }
   },
 
-  renderHighestPriority: function pdfViewRenderHighestPriority() {
+  renderHighestPriority:
+      function pdfViewRenderHighestPriority(currentlyVisiblePages) {
     if (PDFView.idleTimeout) {
       clearTimeout(PDFView.idleTimeout);
       PDFView.idleTimeout = null;
     }
 
     // Pages have a higher priority than thumbnails, so check them first.
-    var visiblePages = this.getVisiblePages();
+    var visiblePages = currentlyVisiblePages || this.getVisiblePages();
     var pageView = this.getHighestPriority(visiblePages, this.pages,
                                            this.pageViewScroll.down);
     if (pageView) {
@@ -1925,7 +1926,7 @@ function updateViewarea() {
     return;
   }
 
-  PDFView.renderHighestPriority();
+  PDFView.renderHighestPriority(visible);
 
   var currentId = PDFView.page;
   var firstPage = visible.first;

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