From 7bc4bfcc8b7f52b14107f0a551becdf01643c5c2 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Tue, 28 Aug 2018 10:06:19 +0200 Subject: [PATCH] Add 'documentinit'/'documentloaded' events to `PDFViewerApplication.load` The new events follow the same naming pattern as the 'pagesinit'/'pagesloaded' events dispatched on `BaseViewer` instances, and the intention is to allow the eventual removal of 'documentload'. --- web/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/app.js b/web/app.js index 34a4a6adf..c5bd4ff3a 100644 --- a/web/app.js +++ b/web/app.js @@ -897,6 +897,9 @@ let PDFViewerApplication = { this.loadingBar.hide(); firstPagePromise.then(() => { + this.eventBus.dispatch('documentloaded', { source: this, }); + // TODO: Remove the following event, i.e. 'documentload', + // once the mozilla-central tests have been updated. this.eventBus.dispatch('documentload', { source: this, }); }); }); @@ -1000,6 +1003,7 @@ let PDFViewerApplication = { this.setInitialView(hash, { rotation, sidebarView, scrollMode, spreadMode, }); + this.eventBus.dispatch('documentinit', { source: this, }); // Make all navigation keys work on document load, // unless the viewer is embedded in a web page.