Menubar.Status.js 798 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. Menubar.Status = function ( editor ) {
  5. var container = new UI.Panel();
  6. container.setClass( 'menu right' );
  7. var checkbox = new UI.Checkbox( editor.config.getKey( 'autosave' ) );
  8. checkbox.onChange( function () {
  9. var value = this.getValue();
  10. editor.config.setKey( 'autosave', value );
  11. if ( value === true ) {
  12. editor.signals.sceneGraphChanged.dispatch();
  13. }
  14. } );
  15. container.add( checkbox );
  16. var title = new UI.Panel();
  17. title.setClass( 'title' );
  18. title.setTextContent( 'Autosave' );
  19. container.add( title );
  20. editor.signals.savingStarted.add( function () {
  21. title.setTextDecoration( 'underline' );
  22. } );
  23. editor.signals.savingFinished.add( function () {
  24. title.setTextDecoration( 'none' );
  25. } );
  26. return container;
  27. };