Merge pull request #165 from jcass77/fix/53_fullscreen_scrolling
Fix scrolling in full screen for Chrome and Safari.
This commit is contained in:
commit
5629d15d02
@ -73,6 +73,7 @@ v2.2.0 (UNRELEASED)
|
||||
**Fixes**
|
||||
|
||||
- Prevent mobile devices from scaling when used in landscape mode. (Fixes: `#157 <https://github.com/pimusicbox/mopidy-musicbox-webclient/issues/157>`_).
|
||||
- Scrolling now works in full screen mode for Chrome and Safari as well. (Fixes: `#53 <https://github.com/pimusicbox/mopidy-musicbox-webclient/issues/53>`_).
|
||||
|
||||
v2.1.1 (2016-02-04)
|
||||
-------------------
|
||||
|
||||
@ -97,13 +97,9 @@
|
||||
<a href="/alarmclock/">
|
||||
<span class="navtxt"> Alarm Clock </span><i class="fa fa-clock-o"></i></a>
|
||||
</li>
|
||||
<li id="navEnterFullscreen" data-icon="false">
|
||||
<li id="navToggleFullscreen" data-icon="false">
|
||||
<a href="#">
|
||||
<span class="navtxt"> Fullscreen </span><i class="fa fa-desktop"></i></a>
|
||||
</li>
|
||||
<li id="navExitFullscreen" class="hidden" data-icon="false">
|
||||
<a href="#">
|
||||
<span class="navtxt"> Exit Fullscreen </span><i class="fa fa-desktop"></i></a>
|
||||
<span class="navtxt" id="toggletxt"> Fullscreen </span><i class="fa fa-desktop"></i></a>
|
||||
</li>
|
||||
<li id="navSettings" data-icon="false">
|
||||
<a href="/settings/">
|
||||
|
||||
@ -308,43 +308,35 @@ $(document).bind("pageinit", function() {
|
||||
/**************
|
||||
* gui stuff *
|
||||
**************/
|
||||
function enterFullscreen() {
|
||||
function toggleFullscreen() {
|
||||
if (isMobileSafari) { alert ("To get this app in Full Screen, you have to add it to your home-screen using the Share button."); exit(); }
|
||||
var elem = document.querySelector("#page");
|
||||
elem.onwebkitfullscreenchange = onFullScreenEnter;
|
||||
elem.onmozfullscreenchange = onFullScreenEnter;
|
||||
elem.onfullscreenchange = onFullScreenEnter;
|
||||
if (elem.webkitRequestFullscreen) {
|
||||
elem.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
|
||||
} else {
|
||||
if (elem.mozRequestFullScreen) {
|
||||
elem.mozRequestFullScreen();
|
||||
} else {
|
||||
elem.requestFullscreen();
|
||||
if (!document.fullscreenElement && // alternative standard method
|
||||
!document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) { // current working methods
|
||||
var docElm = document.documentElement;
|
||||
if (docElm.requestFullscreen) {
|
||||
docElm.requestFullscreen();
|
||||
} else if (docElm.msRequestFullscreen) {
|
||||
docElm.msRequestFullscreen();
|
||||
} else if (docElm.mozRequestFullScreen) {
|
||||
docElm.mozRequestFullScreen();
|
||||
} else if (docElm.webkitRequestFullScreen) {
|
||||
docElm.webkitRequestFullScreen();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function exitFullscreen() {
|
||||
document.webkitExitFullscreen();
|
||||
document.mozCancelFullscreen();
|
||||
document.getElementById("toggletxt").innerHTML = "Exit Fullscreen";
|
||||
} else {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
} else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen();
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
} else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen();
|
||||
}
|
||||
document.getElementById("toggletxt").innerHTML = "Fullscreen";
|
||||
}
|
||||
}
|
||||
|
||||
function onFullScreenEnter() {
|
||||
var elem = document.querySelector("#page");
|
||||
$('#navExitFullscreen').show();
|
||||
$('#navEnterFullscreen').hide();
|
||||
elem.onwebkitfullscreenchange = onFullScreenExit;
|
||||
elem.onmozfullscreenchange = onFullScreenExit;
|
||||
};
|
||||
|
||||
// Called whenever the browser exits fullscreen.
|
||||
function onFullScreenExit() {
|
||||
$('#navExitFullscreen').hide();
|
||||
$('#navEnterFullscreen').show();
|
||||
};
|
||||
|
||||
function switchContent(divid, uri) {
|
||||
var hash = divid;
|
||||
if (uri) {
|
||||
@ -521,11 +513,8 @@ $(document).ready(function(event) {
|
||||
$('#controlspopupimage').click(
|
||||
function() {
|
||||
return switchContent('current')} );
|
||||
$('#navEnterFullscreen').click(function(){
|
||||
enterFullscreen();
|
||||
});
|
||||
$('#navExitFullscreen').click(function(){
|
||||
exitFullscreen();
|
||||
$('#navToggleFullscreen').click(function(){
|
||||
toggleFullscreen();
|
||||
});
|
||||
|
||||
// remove buttons only for MusicBox
|
||||
@ -575,11 +564,6 @@ $(document).ready(function(event) {
|
||||
$("#panel").panel("open");
|
||||
}
|
||||
|
||||
//hide fullscreen button if in UIWebview
|
||||
if (window.navigator.standalone) {
|
||||
$('#navExitFullscreen').hide();
|
||||
}
|
||||
|
||||
$.event.special.swipe.horizontalDistanceThreshold = 125; // (default: 30px) Swipe horizontal displacement must be more than this.
|
||||
$.event.special.swipe.verticalDistanceThreshold = 50; // (default: 75px) Swipe vertical displacement must be less than this.
|
||||
$.event.special.swipe.durationThreshold = 500;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
CACHE MANIFEST
|
||||
|
||||
# 2016-02-06:v1
|
||||
# 2016-02-14:v1
|
||||
|
||||
NETWORK:
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user