[Pkg-javascript-commits] [pdf.js] 78/106: Check availability of canvas & PDF before printing

David Prévot taffit at moszumanska.debian.org
Sat Jun 20 21:35:02 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 f4ba0e342e0de0bf94eb5b38d520c1d751d2d64b
Author: Rob Wu <rob at robwu.nl>
Date:   Fri Jun 5 23:55:08 2015 +0200

    Check availability of canvas & PDF before printing
---
 web/mozPrintCallback_polyfill.js | 2 +-
 web/viewer.js                    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/web/mozPrintCallback_polyfill.js b/web/mozPrintCallback_polyfill.js
index a9416c1..8127a8e 100644
--- a/web/mozPrintCallback_polyfill.js
+++ b/web/mozPrintCallback_polyfill.js
@@ -82,7 +82,7 @@
 
   function renderProgress() {
     var progressContainer = document.getElementById('mozPrintCallback-shim');
-    if (canvases) {
+    if (canvases && canvases.length) {
       var progress = Math.round(100 * index / canvases.length);
       var progressBar = progressContainer.querySelector('progress');
       var progressPerc = progressContainer.querySelector('.relative-progress');
diff --git a/web/viewer.js b/web/viewer.js
index 0b473c0..36178a7 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -1101,7 +1101,7 @@ var PDFViewerApplication = {
 
     var alertNotReady = false;
     var i, ii;
-    if (!this.pagesCount) {
+    if (!this.pdfDocument || !this.pagesCount) {
       alertNotReady = true;
     } else {
       for (i = 0, ii = this.pagesCount; i < ii; ++i) {

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