[Pkg-javascript-commits] [pdf.js] 31/210: Ensure that the viewer loads even if there are errors when the preferences are read

David Prévot taffit at moszumanska.debian.org
Thu Jun 5 14:20:58 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 159e86f7ab19a88266b0606cef64c57ffeb8cfe9
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Sun Apr 27 11:55:45 2014 +0200

    Ensure that the viewer loads even if there are errors when the preferences are read
---
 web/hand_tool.js | 6 +++---
 web/viewer.js    | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/web/hand_tool.js b/web/hand_tool.js
index 0405a68..1076557 100644
--- a/web/hand_tool.js
+++ b/web/hand_tool.js
@@ -45,11 +45,11 @@ var HandTool = {
       toggleHandTool.addEventListener('click', this.toggle.bind(this), false);
 
       window.addEventListener('localized', function (evt) {
-        Preferences.get('enableHandToolOnLoad').then(function (prefValue) {
-          if (prefValue) {
+        Preferences.get('enableHandToolOnLoad').then(function resolved(value) {
+          if (value) {
             this.handTool.activate();
           }
-        }.bind(this));
+        }.bind(this), function rejected(reason) {});
       }.bind(this));
     }
   },
diff --git a/web/viewer.js b/web/viewer.js
index c9fed63..ca85c1c 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -222,9 +222,9 @@ var PDFView = {
     }, false);
 
     var initializedPromise = Promise.all([
-      Preferences.get('enableWebGL').then(function (value) {
+      Preferences.get('enableWebGL').then(function resolved(value) {
         PDFJS.disableWebGL = !value;
-      })
+      }, function rejected(reason) {})
       // TODO move more preferences and other async stuff here
     ]);
 
@@ -1042,8 +1042,8 @@ var PDFView = {
 //      self.container.blur();
 //#endif
       }
-    }, function rejected(errorMsg) {
-      console.error(errorMsg);
+    }, function rejected(reason) {
+      console.error(reason);
 
       firstPagePromise.then(function () {
         self.setInitialView(null, scale);

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