[BUGFIX] Fullscreen firefox legacy & chrome

This commit is contained in:
Xaver Maierhofer 2018-08-01 16:05:50 +02:00
parent 25212adb81
commit e1d3a3d7b2
No known key found for this signature in database
GPG Key ID: 7FDCE23FD2EC9FE8

View File

@ -178,17 +178,17 @@ define({
ctx.fill(); ctx.fill();
}, },
fullscreen: function fullscreen(btn) { fullscreen: function fullscreen(btn) {
if (!document.fullscreenElement) { if (!document.fullscreenElement && !document.webkitFullscreenElement && !document.mozFullScreenElement) {
var fel = document.firstElementChild; var fel = document.firstElementChild;
var func = fel.requestFullscreen var func = fel.requestFullscreen
|| fel.webkitRequestFullScreen || fel.webkitRequestFullScreen
|| fel.msRequestFullscreen; || fel.mozRequestFullScreen;
func.call(fel); func.call(fel);
btn.classList.add('ion-full-exit'); btn.classList.add('ion-full-exit');
} else { } else {
func = document.exitFullscreen func = document.exitFullscreen
|| document.webkitexitFullscreen || document.webkitExitFullscreen
|| document.msexitFullscreen; || document.mozCancelFullScreen;
if (func) { if (func) {
func.call(document); func.call(document);
btn.classList.add('ion-full-enter'); btn.classList.add('ion-full-enter');