[Pkg-javascript-commits] [pdf.js] 05/56: Ensure that the errorWrapper is closed when a new document is opened (issue 4625)

David Prévot taffit at moszumanska.debian.org
Thu May 15 15:17:42 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 12f3d58506f6c3dd2d6563699e314e8e5cf02c41
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Tue Apr 15 12:00:46 2014 +0200

    Ensure that the errorWrapper is closed when a new document is opened (issue 4625)
---
 web/viewer.js | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/web/viewer.js b/web/viewer.js
index 9ecfc0d..8eb20fe 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -561,6 +561,9 @@ var PDFView = {
   },
 
   close: function pdfViewClose() {
+    var errorWrapper = document.getElementById('errorWrapper');
+    errorWrapper.setAttribute('hidden', 'true');
+
     if (!this.pdfDocument) {
       return;
     }
@@ -568,9 +571,6 @@ var PDFView = {
     this.pdfDocument.destroy();
     this.pdfDocument = null;
 
-    var errorWrapper = document.getElementById('errorWrapper');
-    errorWrapper.setAttribute('hidden', 'true');
-
     var thumbsView = document.getElementById('thumbnailView');
     while (thumbsView.hasChildNodes()) {
       thumbsView.removeChild(thumbsView.lastChild);
@@ -594,11 +594,10 @@ var PDFView = {
   open: function pdfViewOpen(url, scale, password,
                              pdfDataRangeTransport, args) {
     if (this.pdfDocument) {
-      this.close();
-
       // Reload the preferences if a document was previously opened.
       Preferences.reload();
     }
+    this.close();
 
     var parameters = {password: password};
     if (typeof url === 'string') { // URL

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