mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-25 12:23:49 +01:00
46 lines
798 B
JavaScript
46 lines
798 B
JavaScript
|
/**
|
||
|
* @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;
|
||
|
|
||
|
};
|