Sidebar.Settings.js 830 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. Sidebar.Settings = function ( editor ) {
  5. var config = editor.config;
  6. var signals = editor.signals;
  7. var container = new UI.Panel();
  8. container.setBorderTop( '0' );
  9. container.setPaddingTop( '20px' );
  10. // class
  11. var options = {
  12. 'css/light.css': 'light',
  13. 'css/dark.css': 'dark'
  14. };
  15. var themeRow = new UI.Row();
  16. var theme = new UI.Select().setWidth( '150px' );
  17. theme.setOptions( options );
  18. if ( config.getKey( 'theme' ) !== undefined ) {
  19. theme.setValue( config.getKey( 'theme' ) );
  20. }
  21. theme.onChange( function () {
  22. var value = this.getValue();
  23. editor.setTheme( value );
  24. editor.config.setKey( 'theme', value );
  25. } );
  26. themeRow.add( new UI.Text( 'Theme' ).setWidth( '90px' ) );
  27. themeRow.add( theme );
  28. container.add( themeRow );
  29. return container;
  30. };