Break dependencies between PresentationMode and other code, and add PresentationMode related utility methods to PDFViewer
This patch: - Adds a couple of utility methods to `PDFViewer` to enable checking `presentationModeState` without cumbersome comparisons. - Disentangles `PresentationMode` from `PDFHistory` and `HandTool`, by adding event listeners for `presentationmodechanged` to both of them. - Adds a utility function to `PDFViewerApplication` for requesting PresentationMode. - Prevents initialization of `PresentationMode` if the browser does not support the fullscreen API.
This commit is contained in:
parent
846eb967cc
commit
2dc1af8028
6 changed files with 83 additions and 63 deletions
|
@ -25,7 +25,6 @@ var SecondaryToolbar = {
|
|||
|
||||
initialize: function secondaryToolbarInitialize(options) {
|
||||
this.toolbar = options.toolbar;
|
||||
this.presentationMode = options.presentationMode;
|
||||
this.documentProperties = options.documentProperties;
|
||||
this.buttonContainer = this.toolbar.firstElementChild;
|
||||
|
||||
|
@ -72,7 +71,7 @@ var SecondaryToolbar = {
|
|||
|
||||
// Event handling functions.
|
||||
presentationModeClick: function secondaryToolbarPresentationModeClick(evt) {
|
||||
this.presentationMode.request();
|
||||
PDFViewerApplication.requestPresentationMode();
|
||||
this.close();
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue