1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- import { UIPanel, UIRow } from './libs/ui.js';
- function MenubarView( editor ) {
- var container = new UIPanel();
- container.setClass( 'menu' );
- var title = new UIPanel();
- title.setClass( 'title' );
- title.setTextContent( 'View' );
- container.add( title );
- var options = new UIPanel();
- options.setClass( 'options' );
- container.add( options );
- // Fullscreen
- var option = new UIRow();
- option.setClass( 'option' );
- option.setTextContent( 'Fullscreen' );
- option.onClick( function () {
- if ( document.fullscreenElement === null ) {
- document.documentElement.requestFullscreen();
- } else if ( document.exitFullscreen ) {
- document.exitFullscreen();
- }
- // Safari
- if ( document.webkitFullscreenElement === null ) {
- document.documentElement.webkitRequestFullscreen();
- } else if ( document.webkitExitFullscreen ) {
- document.webkitExitFullscreen();
- }
- } );
- options.add( option );
- return container;
- }
- export { MenubarView };
|