Ensure that the viewer loads even if there are errors when the preferences are read
This commit is contained in:
parent
42ed9025ef
commit
159e86f7ab
@ -45,11 +45,11 @@ var HandTool = {
|
|||||||
toggleHandTool.addEventListener('click', this.toggle.bind(this), false);
|
toggleHandTool.addEventListener('click', this.toggle.bind(this), false);
|
||||||
|
|
||||||
window.addEventListener('localized', function (evt) {
|
window.addEventListener('localized', function (evt) {
|
||||||
Preferences.get('enableHandToolOnLoad').then(function (prefValue) {
|
Preferences.get('enableHandToolOnLoad').then(function resolved(value) {
|
||||||
if (prefValue) {
|
if (value) {
|
||||||
this.handTool.activate();
|
this.handTool.activate();
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this), function rejected(reason) {});
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -222,9 +222,9 @@ var PDFView = {
|
|||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
var initializedPromise = Promise.all([
|
var initializedPromise = Promise.all([
|
||||||
Preferences.get('enableWebGL').then(function (value) {
|
Preferences.get('enableWebGL').then(function resolved(value) {
|
||||||
PDFJS.disableWebGL = !value;
|
PDFJS.disableWebGL = !value;
|
||||||
})
|
}, function rejected(reason) {})
|
||||||
// TODO move more preferences and other async stuff here
|
// TODO move more preferences and other async stuff here
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -1042,8 +1042,8 @@ var PDFView = {
|
|||||||
// self.container.blur();
|
// self.container.blur();
|
||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
}, function rejected(errorMsg) {
|
}, function rejected(reason) {
|
||||||
console.error(errorMsg);
|
console.error(reason);
|
||||||
|
|
||||||
firstPagePromise.then(function () {
|
firstPagePromise.then(function () {
|
||||||
self.setInitialView(null, scale);
|
self.setInitialView(null, scale);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user