diff --git a/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js b/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js index 3581606f7a..6ba972cfeb 100644 --- a/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js +++ b/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js @@ -139,14 +139,12 @@ angular.module('navigation').directive('guacUserMenu', [function guacUserMenu() */ $scope.fullscreen = function fullscreen() { var elem = document.documentElement; + var fullscreenElem = !(!document.fullscreenElement && + !document.msFullscreenElement && + !document.mozFullScreenElement && + !document.webkitFullscreenElement); - if (!elem.fullscreenElement) { - elem.fullscreenElement = (elem.mozFullScreenElement - || elem.webkitFullscreenElement - || elem.msFullscreenElement).bind(elem); - } - - if (!elem.fullscreenElement) { + if (!fullscreenElem) { if (!elem.requestFullscreen) { elem.requestFullscreen = (elem.mozRequestFullScreen || elem.webkitRequestFullscreen