Menubar.View.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. Menubar.View = function ( editor ) {
  2. var container = new UI.Panel();
  3. container.setClass( 'menu' );
  4. container.onMouseOver( function () { options.setDisplay( 'block' ) } );
  5. container.onMouseOut( function () { options.setDisplay( 'none' ) } );
  6. container.onClick( function () { options.setDisplay( 'block' ) } );
  7. var title = new UI.Panel();
  8. title.setTextContent( 'View' );
  9. title.setMargin( '0px' );
  10. title.setPadding( '8px' );
  11. container.add( title );
  12. //
  13. var options = new UI.Panel();
  14. options.setClass( 'options' );
  15. options.setDisplay( 'none' );
  16. container.add( options );
  17. // themes
  18. var option = new UI.Panel();
  19. option.setClass( 'option' );
  20. option.setTextContent( 'Light theme' );
  21. option.onClick( function () {
  22. editor.setTheme( 'css/light.css' );
  23. } );
  24. options.add( option );
  25. // about
  26. var option = new UI.Panel();
  27. option.setClass( 'option' );
  28. option.setTextContent( 'Dark theme' );
  29. option.onClick( function () {
  30. editor.setTheme( 'css/dark.css' );
  31. } );
  32. options.add( option );
  33. //
  34. return container;
  35. }