Menubar.View.js 685 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. Menubar.View = function ( editor ) {
  5. var container = new UI.Panel();
  6. container.setClass( 'menu' );
  7. var title = new UI.Panel();
  8. title.setClass( 'title' );
  9. title.setTextContent( 'View' );
  10. container.add( title );
  11. var options = new UI.Panel();
  12. options.setClass( 'options' );
  13. container.add( options );
  14. // VR mode
  15. var option = new UI.Row();
  16. option.setClass( 'option' );
  17. option.setTextContent( 'VR mode' );
  18. option.onClick( function () {
  19. if ( WEBVR.isAvailable() === true ) {
  20. editor.signals.enterVR.dispatch();
  21. } else {
  22. alert( 'WebVR not available' );
  23. }
  24. } );
  25. options.add( option );
  26. return container;
  27. };