Browse Source

Editor: Fixed Script panel behaviour.

Mr.doob 11 years ago
parent
commit
7be6e2a4e5
1 changed files with 15 additions and 0 deletions
  1. 15 0
      editor/js/Sidebar.Script.js

+ 15 - 0
editor/js/Sidebar.Script.js

@@ -4,6 +4,7 @@ Sidebar.Script = function ( editor ) {
 
 	var container = new UI.CollapsiblePanel();
 	container.setCollapsed( true );
+	container.setDisplay( 'none' );
 
 	container.addStatic( new UI.Text( 'Script' ).setTextTransform( 'uppercase' ) );
 	container.add( new UI.Break() );
@@ -11,6 +12,20 @@ Sidebar.Script = function ( editor ) {
 	var scriptsRow = new UI.Panel();
 	container.add( scriptsRow );
 
+	signals.objectSelected.add( function ( object ) {
+
+		if ( object !== null ) {
+
+			container.setDisplay( 'block' );
+
+		} else {
+
+			container.setDisplay( 'none' );
+
+		}
+
+	} );
+
 	return container;
 
 }