Skip to content

Commit

Permalink
Factored out backgroundColor var, see #222
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Mar 4, 2015
1 parent ff21331 commit 7cb236d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions js/Sim.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,13 @@ define( function( require ) {
sim.navigationBar = new NavigationBar( NAVIGATION_BAR_SIZE, sim, screens, sim.simModel );

this.updateBackground = function() {
sim.display.backgroundColor = sim.currentScreen ?
sim.currentScreen.backgroundColor.toCSS() :
'black';
var backgroundColor = sim.currentScreen ?
sim.currentScreen.backgroundColor.toCSS() :
'black';

sim.lookAndFeel.setBackgroundColor( sim.display.backgroundColor );
sim.display.backgroundColor = backgroundColor;

sim.lookAndFeel.setBackgroundColor( backgroundColor );
};

sim.simModel.multilink( [ 'showHomeScreen', 'screenIndex' ], function() {
Expand Down

0 comments on commit 7cb236d

Please sign in to comment.