diff --git a/js/common/model/Mass.js b/js/common/model/Mass.js index cb480c41..ac50f0d9 100644 --- a/js/common/model/Mass.js +++ b/js/common/model/Mass.js @@ -364,6 +364,7 @@ define( function( require ) { this.isAnimatingProperty.set( false ); } } + // If we're not animating/controlled or attached to a spring, we'll fall due to gravity else if ( this.springProperty.get() === null && !this.userControlledProperty.get() ) { var oldY = this.positionProperty.get().y; diff --git a/js/common/model/Spring.js b/js/common/model/Spring.js index ab007377..1ffae9c9 100644 --- a/js/common/model/Spring.js +++ b/js/common/model/Spring.js @@ -533,6 +533,7 @@ define( function( require ) { assert && assert( !isNaN( this.massAttachedProperty.get().verticalVelocityProperty.get() ), 'velocity must be a number' ); } + // Critically damped case else { //TODO:: if needed decouple these objects diff --git a/js/common/view/DraggableTimerNode.js b/js/common/view/DraggableTimerNode.js index 309c1544..df57546c 100644 --- a/js/common/view/DraggableTimerNode.js +++ b/js/common/view/DraggableTimerNode.js @@ -58,6 +58,7 @@ define( function( require ) { tandem: tandem.createTandem( 'positionProperty' ), phetioType: PropertyIO( Vector2IO ) } ); + //REVIEW: Use `this` instead of self here? this.positionProperty.linkAttribute( self, 'translation' ); //REVIEW: Specify read-write as (read-only) AFTER the type docs. Add type docs here. @@ -79,6 +80,7 @@ define( function( require ) { } } ); this.addInputListener( this.timerNodeMovableDragHandler ); + //REVIEW: Use `this` instead of self here? visibleProperty.linkAttribute( self, 'visible' ); } diff --git a/js/common/view/EnergyGraphNode.js b/js/common/view/EnergyGraphNode.js index efcc9471..82184421 100644 --- a/js/common/view/EnergyGraphNode.js +++ b/js/common/view/EnergyGraphNode.js @@ -275,6 +275,7 @@ define( function( require ) { } ) } ); } + // close it on a click var closeListener = new ButtonListener( { fire: dialog.hide.bind( dialog ) diff --git a/js/common/view/MassNode.js b/js/common/view/MassNode.js index 816a0b16..eecc81f3 100644 --- a/js/common/view/MassNode.js +++ b/js/common/view/MassNode.js @@ -137,6 +137,7 @@ define( function( require ) { } ); if ( mass.isLabeled ) { + //REVIEW: Use `this` instead of self here? self.addChild( label ); } mass.massProperty.link( function() { @@ -145,6 +146,7 @@ define( function( require ) { // Adjust the mass label for adjustable masses. if ( this.mass.adjustable ) { + //REVIEW: Use `this` instead of self here? self.mass.massProperty.link( function( massValue ) { label.setText( StringUtils.fillIn( massValueString, { mass: Util.roundSymmetric( massValue * 1000 ) } ) ); label.center = rect.center; @@ -261,15 +263,19 @@ define( function( require ) { }; // Show/hide the velocity arrow + //REVIEW: Use `this` instead of self here? updateArrowVisibility( model.velocityVectorVisibilityProperty, self.velocityArrow ); // Show/hide the acceleration arrow + //REVIEW: Use `this` instead of self here? updateArrowVisibility( model.accelerationVectorVisibilityProperty, self.accelerationArrow ); // Show/hide the spring force arrow + //REVIEW: Use `this` instead of self here? updateForceVisiblity( model.springVectorVisibilityProperty, self.springForceArrow ); // Show/hide the gravity force arrow + //REVIEW: Use `this` instead of self here? updateForceVisiblity( model.gravityVectorVisibilityProperty, self.gravityForceArrow ); // Show/hide the net force arrow diff --git a/js/common/view/MovableLineNode.js b/js/common/view/MovableLineNode.js index 6878a3c0..41a86348 100644 --- a/js/common/view/MovableLineNode.js +++ b/js/common/view/MovableLineNode.js @@ -86,6 +86,7 @@ define( function( require ) { tandem: tandem.createTandem( 'dragHandler' ) } ) ); + //REVIEW: Use `this` instead of self here? visibleProperty.linkAttribute( self, 'visible' ); this.addChild( line ); diff --git a/js/common/view/OscillatingSpringNode.js b/js/common/view/OscillatingSpringNode.js index f8fcc00c..6a1dfefa 100644 --- a/js/common/view/OscillatingSpringNode.js +++ b/js/common/view/OscillatingSpringNode.js @@ -106,7 +106,6 @@ define( function( require ) { } }, { - // statics MAP_NUMBER_OF_LOOPS: MAP_NUMBER_OF_LOOPS } ); } ); \ No newline at end of file diff --git a/js/common/view/ReferenceLineNode.js b/js/common/view/ReferenceLineNode.js index 7bf66aa6..8b7e8104 100644 --- a/js/common/view/ReferenceLineNode.js +++ b/js/common/view/ReferenceLineNode.js @@ -87,6 +87,7 @@ define( function( require ) { self.translation = position.minus( new Vector2( LINE_LENGTH / 2, 0 ) ); } ); + //REVIEW: Use `this` instead of self here? visibleProperty.linkAttribute( self, 'visible' ); //REVIEW: Lots of similarities between this and MovableLineNode. Could be considered to be factored out. diff --git a/js/intro/model/IntroModel.js b/js/intro/model/IntroModel.js index e5009b61..6985a9f3 100644 --- a/js/intro/model/IntroModel.js +++ b/js/intro/model/IntroModel.js @@ -115,6 +115,7 @@ define( function( require ) { } ); // Manages logic for updating spring thickness and spring constant + //REVIEW: Use `this` instead of self here? self.spring1.naturalRestingLengthProperty.link( function( naturalRestingLength ) { //REVIEW: Style guide wants one space after // @@ -129,6 +130,7 @@ define( function( require ) { } } ); + //REVIEW: Use `this` instead of self here? self.constantParameterProperty.link( function( selectedConstant ) { // Manages logic for changing between constant parameters // TODO: Enumerate these constants for checks