From 159e86f7ab19a88266b0606cef64c57ffeb8cfe9 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 27 Apr 2014 11:55:45 +0200 Subject: [PATCH] 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 0405a68a6..1076557c8 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 c9fed6306..ca85c1cd3 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);