Browse Source

Editor: Simplified fog panel visibility code.

Mr.doob 12 years ago
parent
commit
5b175236b1
1 changed files with 4 additions and 29 deletions
  1. 4 29
      editor/js/ui/Sidebar.Scene.js

+ 4 - 29
editor/js/ui/Sidebar.Scene.js

@@ -134,37 +134,12 @@ Sidebar.Scene = function ( signals ) {
 
 		var type = fogType.getValue();
 
-		if ( type === "None" ) {
+		fogColorRow.setDisplay( type === 'None' ? 'none' : '' );
 
-			fogColorRow.setDisplay( 'none' );
+		fogNearRow.setDisplay( type === 'Fog' ? '' : 'none' );
+		fogFarRow.setDisplay( type === 'Fog' ? '' : 'none' );
 
-		} else {
-
-			fogColorRow.setDisplay( '' );
-
-		}
-
-		if ( type === "Fog" ) {
-
-			fogNearRow.setDisplay( '' );
-			fogFarRow.setDisplay( '' );
-
-		} else {
-
-			fogNearRow.setDisplay( 'none' );
-			fogFarRow.setDisplay( 'none' );
-
-		}
-
-		if ( type === "FogExp2" ) {
-
-			fogDensityRow.setDisplay( '' );
-
-		} else {
-
-			fogDensityRow.setDisplay( 'none' );
-
-		}
+		fogDensityRow.setDisplay( type === 'FogExp2' ? '' : 'none' );
 
 	}