Doodle3D-Slicer/three.js-master/editor_slicer/js/Menubar.Status.js

46 lines
798 B
JavaScript
Raw Normal View History

2015-06-12 15:58:26 +02:00
/**
* @author mrdoob / http://mrdoob.com/
*/
Menubar.Status = function ( editor ) {
var container = new UI.Panel();
container.setClass( 'menu right' );
var checkbox = new UI.Checkbox( editor.config.getKey( 'autosave' ) );
checkbox.onChange( function () {
var value = this.getValue();
editor.config.setKey( 'autosave', value );
if ( value === true ) {
editor.signals.sceneGraphChanged.dispatch();
}
} );
container.add( checkbox );
var title = new UI.Panel();
title.setClass( 'title' );
title.setTextContent( 'Autosave' );
container.add( title );
editor.signals.savingStarted.add( function () {
title.setTextDecoration( 'underline' );
} );
editor.signals.savingFinished.add( function () {
title.setTextDecoration( 'none' );
} );
return container;
};