Skip to content

Commit

Permalink
use && pattern to add optional subcomponents, #261
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Aug 23, 2016
1 parent 30dd38d commit d933a14
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions js/WavelengthSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,10 @@ define( function( require ) {
thisNode.addChild( track );
thisNode.addChild( trackBorder );
thisNode.addChild( thumb );
if ( valueDisplay ) { thisNode.addChild( valueDisplay ); }
if ( cursor ) { thisNode.addChild( cursor ); }
if ( options.tweakersVisible ) {
thisNode.addChild( plusButton );
thisNode.addChild( minusButton );
}
valueDisplay && thisNode.addChild( valueDisplay );
cursor && thisNode.addChild( cursor );
plusButton && thisNode.addChild( plusButton );
minusButton && thisNode.addChild( minusButton );

// layout
if ( cursor ) { cursor.top = track.top; }
Expand Down

0 comments on commit d933a14

Please sign in to comment.