ManageIQ/manageiq-ui-classic

View on GitHub
app/javascript/oldjs/remote_console.js

Summary

Maintainability
A
2 hrs
Test Coverage
$(function() {
  $('#fullscreen').click(function() {
    switch (true) {
      case document.fullScreenEnabled:
        if (document.fullscreenElement) {
          document.exitFullscreen();
        } else {
          document.documentElement.requestFullscreen();
        }
        break;
      case document.webkitFullscreenEnabled:
        if (document.webkitFullscreenElement) {
          document.webkitExitFullscreen();
        } else {
          document.documentElement.webkitRequestFullscreen();
        }
        break;
      case document.mozFullScreenEnabled:
        if (document.mozFullScreenElement) {
          document.mozCancelFullScreen();
        } else {
          document.documentElement.mozRequestFullScreen();
        }
        break;
      case document.msFullscreenEnabled:
        if (document.msFullscreenElement) {
          document.msExitFullscreen();
        } else {
          document.documentElement.msRequestFullscreen();
        }
        break;
    }
  });
});