FullscreenTool.ts 742 B

1234567891011121314151617181920212223
  1. module INSPECTOR {
  2. export class FullscreenTool extends AbstractTool {
  3. constructor(parent:HTMLElement, inspector:Inspector) {
  4. super('fa', 'fa-expand', parent, inspector, 'Open the scene in fullscreen, press Esc to exit');
  5. }
  6. // Action : refresh the whole panel
  7. public action() {
  8. var elem = document.body;
  9. function requestFullScreen(element:HTMLElement) {
  10. // Supports most browsers and their versions.
  11. var requestMethod = element.requestFullscreen || element.webkitRequestFullScreen;
  12. requestMethod.call(element);
  13. }
  14. requestFullScreen(elem);
  15. }
  16. }
  17. }