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'.
This commit is contained in:
Jonas Jenwald 2018-08-28 10:06:19 +02:00
parent 486c843215
commit 7bc4bfcc8b

View File

@ -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.