[Pkg-javascript-commits] [pdf.js] 162/207: Do not run cleanup while printing is ongoing.

David Prévot taffit at moszumanska.debian.org
Mon Jul 28 15:36:43 UTC 2014


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

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

commit 6447397c047223684f4e8d6f05745ce6b617f84b
Author: Fabian Lange <lange.fabian at gmail.com>
Date:   Wed Jun 25 00:23:42 2014 +0200

    Do not run cleanup while printing is ongoing.
---
 web/viewer.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/web/viewer.js b/web/viewer.js
index 30cdf27..0300ce2 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -117,6 +117,7 @@ var PDFView = {
   fellback: false,
   pdfDocument: null,
   sidebarOpen: false,
+  printing: false,
   pageViewScroll: null,
   thumbnailViewScroll: null,
   pageRotation: 0,
@@ -1256,6 +1257,11 @@ var PDFView = {
       }
     }
 
+    if (this.printing) {
+      // If printing is currently ongoing do not reschedule cleanup.
+      return;
+    }
+
     PDFView.idleTimeout = setTimeout(function () {
       PDFView.cleanup();
     }, CLEANUP_TIMEOUT);
@@ -1565,6 +1571,9 @@ var PDFView = {
       return;
     }
 
+    this.printing = true;
+    this.renderHighestPriority();
+
     var body = document.querySelector('body');
     body.setAttribute('data-mozPrintCallback', true);
     for (i = 0, ii = this.pages.length; i < ii; ++i) {
@@ -1583,6 +1592,9 @@ var PDFView = {
     while (div.hasChildNodes()) {
       div.removeChild(div.lastChild);
     }
+
+    this.printing = false;
+    this.renderHighestPriority();
   },
 
   rotatePages: function pdfViewRotatePages(delta) {

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