Skip to content

Commit 50c4f48

Browse files
committed
Merge pull request mozilla#3667 from thorlarholm/iefullscreen
Support for fullscreen presentationMode in Internet Explorer
2 parents da1c944 + 3c2d079 commit 50c4f48

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

web/viewer.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,20 @@ select {
6464
cursor: none;
6565
}
6666

67+
#viewerContainer:-ms-fullscreen {
68+
top: 0px !important;
69+
border-top: 2px solid transparent;
70+
width: 100%;
71+
height: 100%;
72+
overflow: hidden !important;
73+
cursor: none;
74+
}
75+
76+
#viewerContainer:-ms-fullscreen::-ms-backdrop {
77+
background-color: #404040;
78+
background-image: url(images/texture.png);
79+
}
80+
6781
#viewerContainer:fullscreen {
6882
top: 0px;
6983
border-top: 2px solid transparent;
@@ -83,6 +97,10 @@ select {
8397
margin-bottom: 100%;
8498
}
8599

100+
:-ms-fullscreen .page {
101+
margin-bottom: 100% !important;
102+
}
103+
86104
:fullscreen .page {
87105
margin-bottom: 100%;
88106
}
@@ -95,6 +113,10 @@ select {
95113
display: none;
96114
}
97115

116+
:-ms-fullscreen a:not(.internalLink) {
117+
display: none !important;
118+
}
119+
98120
:fullscreen a:not(.internalLink) {
99121
display: none;
100122
}

web/viewer.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,12 @@ var PDFView = {
392392
get supportsFullscreen() {
393393
var doc = document.documentElement;
394394
var support = doc.requestFullscreen || doc.mozRequestFullScreen ||
395-
doc.webkitRequestFullScreen;
395+
doc.webkitRequestFullScreen || doc.msRequestFullscreen;
396396

397397
if (document.fullscreenEnabled === false ||
398398
document.mozFullScreenEnabled === false ||
399-
document.webkitFullscreenEnabled === false ) {
399+
document.webkitFullscreenEnabled === false ||
400+
document.msFullscreenEnabled === false) {
400401
support = false;
401402
}
402403

@@ -1386,7 +1387,8 @@ var PDFView = {
13861387
presentationMode: function pdfViewPresentationMode() {
13871388
var isPresentationMode = document.fullscreenElement ||
13881389
document.mozFullScreen ||
1389-
document.webkitIsFullScreen;
1390+
document.webkitIsFullScreen ||
1391+
document.msFullscreenElement;
13901392

13911393
if (isPresentationMode) {
13921394
return false;
@@ -1399,6 +1401,8 @@ var PDFView = {
13991401
wrapper.mozRequestFullScreen();
14001402
} else if (document.documentElement.webkitRequestFullScreen) {
14011403
wrapper.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
1404+
} else if (document.documentElement.msRequestFullscreen) {
1405+
wrapper.msRequestFullscreen();
14021406
} else {
14031407
return false;
14041408
}
@@ -2830,7 +2834,8 @@ window.addEventListener('afterprint', function afterPrint(evt) {
28302834
function presentationModeChange(e) {
28312835
var isPresentationMode = document.fullscreenElement ||
28322836
document.mozFullScreen ||
2833-
document.webkitIsFullScreen;
2837+
document.webkitIsFullScreen ||
2838+
document.msFullscreenElement;
28342839

28352840
if (isPresentationMode) {
28362841
PDFView.enterPresentationMode();
@@ -2843,6 +2848,7 @@ window.addEventListener('afterprint', function afterPrint(evt) {
28432848
window.addEventListener('mozfullscreenchange', presentationModeChange, false);
28442849
window.addEventListener('webkitfullscreenchange', presentationModeChange,
28452850
false);
2851+
window.addEventListener('MSFullscreenChange', presentationModeChange, false);
28462852
})();
28472853

28482854
(function animationStartedClosure() {

0 commit comments

Comments
 (0)