From 7362cd40fd3e97b7dfc5d0c4f8809dcadb5c0b0b Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 30 Jul 2018 17:41:39 +0200 Subject: [PATCH] Refactor a number of methods in `PDFViewerApplication` to be `async` rather than manually returning `Promise`s *Ignoring whitespace changes is probably necessary, in order for the diff to be readable.* --- web/app.js | 461 ++++++++++++++++++++++++++--------------------------- 1 file changed, 226 insertions(+), 235 deletions(-) diff --git a/web/app.js b/web/app.js index 933d9eba72998..f4bb94f33c52d 100644 --- a/web/app.js +++ b/web/app.js @@ -133,44 +133,42 @@ let PDFViewerApplication = { contentDispositionFilename: null, // Called once when the document is loaded. - initialize(appConfig) { + async initialize(appConfig) { this.preferences = this.externalServices.createPreferences(); this.appConfig = appConfig; - return this._readPreferences().then(() => { - return this._parseHashParameters(); - }).then(() => { - return this._initializeL10n(); - }).then(() => { - if (this.isViewerEmbedded && - AppOptions.get('externalLinkTarget') === LinkTarget.NONE) { - // Prevent external links from "replacing" the viewer, - // when it's embedded in e.g. an