Skip to content

Commit

Permalink
Added docs for FrictionModel.init, see #64
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 14, 2018
1 parent 9bb9ba3 commit b04dc52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions js/friction/model/FrictionModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ define( function( require ) {
self.tryToEvaporate();
}
} );

this.init();
}

friction.register( 'FrictionModel', FrictionModel );
Expand Down Expand Up @@ -270,8 +272,8 @@ define( function( require ) {
},

/**
* TODO: this must be called from the end of the view construction for unknown reasons, or atoms don't fly off
* TODO: Why? it would be better if this could be called during the constructor.
* This must be called after MagnifierNode adds AtomNodes to the toEvaporateSample, or atoms don't fly off
* TODO: It would be better if this could be called during the constructor and didn't need a view step first
* @public
*/
init: function() {
Expand Down
3 changes: 2 additions & 1 deletion js/friction/view/FrictionScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ define( function( require ) {
tandem: tandem.createTandem( 'resetAllButton' )
} ) );

model.init(); // TODO: does this need to be called here? If so, why?
// Initialize the model now that MagnifierNode has added the toEvaporateSample AtomNodes
model.init();
}

friction.register( 'FrictionScreenView', FrictionScreenView );
Expand Down

0 comments on commit b04dc52

Please sign in to comment.