Skip to content

Commit

Permalink
🐛 Fix shim of browser fullscreen detection
Browse files Browse the repository at this point in the history
Signed-off-by: mathieu.brunot <mathieu.brunot@monogramm.io>
  • Loading branch information
madmath03 committed Feb 5, 2020
1 parent 8ba47a5 commit b2ef33f
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b2ef33f

Please sign in to comment.