mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-30 01:14:57 +01:00
39 lines
617 B
JavaScript
39 lines
617 B
JavaScript
|
/**
|
||
|
* @author mrdoob / http://mrdoob.com/
|
||
|
*/
|
||
|
|
||
|
Menubar.Play = function ( editor ) {
|
||
|
|
||
|
var signals = editor.signals;
|
||
|
|
||
|
var container = new UI.Panel();
|
||
|
container.setClass( 'menu' );
|
||
|
|
||
|
var isPlaying = false;
|
||
|
|
||
|
var title = new UI.Panel();
|
||
|
title.setClass( 'title' );
|
||
|
title.setTextContent( 'Play' );
|
||
|
title.onClick( function () {
|
||
|
|
||
|
if ( isPlaying === false ) {
|
||
|
|
||
|
isPlaying = true;
|
||
|
title.setTextContent( 'Stop' );
|
||
|
signals.startPlayer.dispatch();
|
||
|
|
||
|
} else {
|
||
|
|
||
|
isPlaying = false;
|
||
|
title.setTextContent( 'Play' );
|
||
|
signals.stopPlayer.dispatch();
|
||
|
|
||
|
}
|
||
|
|
||
|
} );
|
||
|
container.add( title );
|
||
|
|
||
|
return container;
|
||
|
|
||
|
};
|