A couple of small BaseViewer tweaks

- Mark `BaseViewer.initializeScriptingEvents` as an `async` method, since that's actually how it's being used in the default viewer (see `PDFViewerApplication-_initializeJavaScript`).

 - Change `BaseViewer._pageWidthScaleFactor` to access the *internal* scroll/spread-modes directly, rather than using the getters, since that's consistent with the rest of the code (and not just for these properties).
This commit is contained in:
Jonas Jenwald 2021-02-14 12:32:50 +01:00
parent c79fd71457
commit 48f4580991

View File

@ -740,8 +740,8 @@ class BaseViewer {
*/
get _pageWidthScaleFactor() {
if (
this.spreadMode !== SpreadMode.NONE &&
this.scrollMode !== ScrollMode.HORIZONTAL &&
this._spreadMode !== SpreadMode.NONE &&
this._scrollMode !== ScrollMode.HORIZONTAL &&
!this.isInPresentationMode
) {
return 2;
@ -1642,7 +1642,7 @@ class BaseViewer {
return true;
}
initializeScriptingEvents() {
async initializeScriptingEvents() {
if (!this.enableScripting || this._pageOpenPendingSet) {
return;
}