diff --git a/app/views/layouts/remote_console.html.haml b/app/views/layouts/remote_console.html.haml
index c24d3d94190..c33bbc2a50e 100644
--- a/app/views/layouts/remote_console.html.haml
+++ b/app/views/layouts/remote_console.html.haml
@@ -45,10 +45,10 @@
}
break;
case document.mozFullScreenEnabled:
- if (document.mozFullscreenElement) {
- document.mozExitFullscreen();
+ if (document.mozFullScreenElement) {
+ document.mozCancelFullScreen();
} else {
- document.documentElement.mozRequestFullscreen();
+ document.documentElement.mozRequestFullScreen();
}
break;
case document.msFullscreenEnabled: