Ensure that the viewer loads even if there are errors when the preferences are read

This commit is contained in:
Jonas Jenwald 2014-04-27 11:55:45 +02:00
parent 42ed9025ef
commit 159e86f7ab
2 changed files with 7 additions and 7 deletions

View File

@ -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));
}
},

View File

@ -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);