Merge pull request #12935 from Snuffleupagus/fullscreen-MOZCENTRAL-rm-prefixes
Remove prefixed fullscreen properties/methods from the MOZCENTRAL builds
This commit is contained in:
commit
c92011e093
10
web/app.js
10
web/app.js
@ -657,14 +657,11 @@ const PDFViewerApplication = {
|
||||
},
|
||||
|
||||
get supportsFullscreen() {
|
||||
let support;
|
||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
||||
support =
|
||||
document.fullscreenEnabled === true ||
|
||||
document.mozFullScreenEnabled === true;
|
||||
} else {
|
||||
return shadow(this, "supportsFullscreen", document.fullscreenEnabled);
|
||||
}
|
||||
const doc = document.documentElement;
|
||||
support = !!(
|
||||
let support = !!(
|
||||
doc.requestFullscreen ||
|
||||
doc.mozRequestFullScreen ||
|
||||
doc.webkitRequestFullScreen
|
||||
@ -677,7 +674,6 @@ const PDFViewerApplication = {
|
||||
) {
|
||||
support = false;
|
||||
}
|
||||
}
|
||||
return shadow(this, "supportsFullscreen", support);
|
||||
},
|
||||
|
||||
|
@ -86,6 +86,13 @@ class PDFPresentationMode {
|
||||
this._setSwitchInProgress();
|
||||
this._notifyStateChange();
|
||||
|
||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
||||
if (this.container.requestFullscreen) {
|
||||
this.container.requestFullscreen();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (this.container.requestFullscreen) {
|
||||
this.container.requestFullscreen();
|
||||
} else if (this.container.mozRequestFullScreen) {
|
||||
@ -95,6 +102,7 @@ class PDFPresentationMode {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
this.args = {
|
||||
page: this.pdfViewer.currentPageNumber,
|
||||
@ -148,6 +156,9 @@ class PDFPresentationMode {
|
||||
}
|
||||
|
||||
get isFullscreen() {
|
||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
||||
return !!document.fullscreenElement;
|
||||
}
|
||||
return !!(
|
||||
document.fullscreenElement ||
|
||||
document.mozFullScreen ||
|
||||
@ -468,8 +479,8 @@ class PDFPresentationMode {
|
||||
this.fullscreenChangeBind = this._fullscreenChange.bind(this);
|
||||
|
||||
window.addEventListener("fullscreenchange", this.fullscreenChangeBind);
|
||||
window.addEventListener("mozfullscreenchange", this.fullscreenChangeBind);
|
||||
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {
|
||||
window.addEventListener("mozfullscreenchange", this.fullscreenChangeBind);
|
||||
window.addEventListener(
|
||||
"webkitfullscreenchange",
|
||||
this.fullscreenChangeBind
|
||||
@ -482,11 +493,11 @@ class PDFPresentationMode {
|
||||
*/
|
||||
_removeFullscreenChangeListeners() {
|
||||
window.removeEventListener("fullscreenchange", this.fullscreenChangeBind);
|
||||
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {
|
||||
window.removeEventListener(
|
||||
"mozfullscreenchange",
|
||||
this.fullscreenChangeBind
|
||||
);
|
||||
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {
|
||||
window.removeEventListener(
|
||||
"webkitfullscreenchange",
|
||||
this.fullscreenChangeBind
|
||||
|
Loading…
x
Reference in New Issue
Block a user