Skip to content

Commit

Permalink
reuse OutOfBallsDialog because hide no longer disposes, see phetsims/…
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Jul 12, 2017
1 parent 5d80107 commit 81dd017
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/lab/view/LabScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,20 @@ define( function( require ) {
}
} );

// OutOfBallsDialog, created lazily because Dialog requires sim bounds during construction
var dialog = null;

// no need to dispose of this link
model.isBallCapReachedProperty.lazyLink( function( isBallCapReached ) {

// when the max number of balls is reached...
if ( isBallCapReached ) {

// pop up a dialog
new OutOfBallsDialog().show();
if ( !dialog ) {
dialog = new OutOfBallsDialog();
}
dialog.show();

// sets the play button to active.
playPanel.setPlayButtonVisible();
Expand Down

0 comments on commit 81dd017

Please sign in to comment.