Skip to content

Commit 0a282f9

Browse files
committedApr 16, 2015
Made fullscreen button visible on mobile
1 parent 5ad6a1a commit 0a282f9

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed
 

‎css/q3demo.css

+9
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ canvas {
118118
}
119119

120120
#mobileVrBtn {
121+
position: absolute;
122+
bottom: 1em;
123+
right: 4em;
124+
}
125+
126+
#mobileFullscreenBtn {
121127
position: absolute;
122128
bottom: 1em;
123129
right: 1em;
@@ -161,4 +167,7 @@ canvas {
161167
#mobileVrBtn {
162168
display: none !important;
163169
}
170+
#mobileFullscreenBtn {
171+
display: none !important;
172+
}
164173
}

‎index.html

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ <h2 id="mapTitle"></h2>
4545
</div>
4646

4747
<img style="display: none;" src="images/vr_goggles_sm.png" id="mobileVrBtn"/>
48+
<img src="images/fullscreen_sm.png" id="mobileFullscreenBtn"/>
4849

4950
<div id="viewport-info" style="display: none;">
5051
<div id="controls">

‎js/main.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -769,10 +769,13 @@ function main() {
769769
}, false);
770770

771771
// Fullscreen
772-
var button = document.getElementById('fullscreenBtn');
773-
button.addEventListener('click', function() {
772+
function goFullscreen() {
774773
viewportFrame.requestFullScreen();
775-
}, false);
774+
}
775+
var fullscreenButton = document.getElementById('fullscreenBtn');
776+
var mobileFullscreenBtn = document.getElementById("mobileFullscreenBtn");
777+
fullscreenButton.addEventListener('click', goFullscreen, false);
778+
mobileFullscreenBtn.addEventListener('click', goFullscreen, false);
776779

777780
// VR
778781
function goVrFullscreen() {
@@ -782,8 +785,8 @@ function main() {
782785
}
783786
var vrBtn = document.getElementById("vrBtn");
784787
var mobileVrBtn = document.getElementById("mobileVrBtn");
785-
vrBtn.addEventListener("click", goVrFullscreen);
786-
mobileVrBtn.addEventListener("click", goVrFullscreen);
788+
vrBtn.addEventListener("click", goVrFullscreen, false);
789+
mobileVrBtn.addEventListener("click", goVrFullscreen, false);
787790

788791
}
789792
window.addEventListener("load", main); // Fire this once the page is loaded up

0 commit comments

Comments
 (0)
Please sign in to comment.