[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
1 changed files with 4 additions and 4 deletions

View File

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