Properly disable presentation mode when the viewer is embedded

This commit is contained in:
Jonas 2013-09-05 00:23:16 +02:00
parent c5bcd7a7ef
commit 3cce7be9ce

View File

@ -400,6 +400,10 @@ var PDFView = {
document.mozFullScreenEnabled === false ||
document.webkitFullscreenEnabled === false ) {
support = false;
} else if (this.isViewerEmbedded) {
// Need to check if the viewer is embedded as well, to prevent issues with
// presentation mode when the viewer is embedded in '<object>' tags.
support = false;
}
Object.defineProperty(this, 'supportsFullscreen', { value: support,
@ -1392,6 +1396,9 @@ var PDFView = {
},
presentationMode: function pdfViewPresentationMode() {
if (!this.supportsFullscreen) {
return false;
}
var isPresentationMode = document.fullscreenElement ||
document.mozFullScreen ||
document.webkitIsFullScreen;