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
|
@ -51,6 +51,17 @@ var HandTool = {
|
|||
}
|
||||
}.bind(this), function rejected(reason) {});
|
||||
}.bind(this));
|
||||
|
||||
window.addEventListener('presentationmodechanged', function (evt) {
|
||||
if (evt.detail.switchInProgress) {
|
||||
return;
|
||||
}
|
||||
if (evt.detail.active) {
|
||||
this.enterPresentationMode();
|
||||
} else {
|
||||
this.exitPresentationMode();
|
||||
}
|
||||
}.bind(this));
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue