Skip to content

Commit

Permalink
Introduced parentheses for ternary expressions for #42
Browse files Browse the repository at this point in the history
  • Loading branch information
Saurabh Totey authored and Saurabh Totey committed Jul 18, 2021
1 parent 00bb665 commit b7035a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js/common/view/DistanceShadedNumberLineNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class DistanceShadedNumberLineNode extends SpatializedNumberLineNode {

// Get which strings to use for point names based on the number line orientation.
// The strings are ordered based on isPrimaryNodeSwapped.
const labelStrings = orientation === Orientation.VERTICAL ?
const labelStrings = ( orientation === Orientation.VERTICAL ) ?
[ NLDConstants.Y_1_STRING, NLDConstants.Y_2_STRING ] : [ NLDConstants.X_1_STRING, NLDConstants.X_2_STRING ];
if ( isPrimaryNodeSwapped ) {
const temp = labelStrings[ 0 ];
Expand Down Expand Up @@ -138,7 +138,7 @@ class DistanceShadedNumberLineNode extends SpatializedNumberLineNode {
// on each end. The endpoint positions are needed in case a point is off the scale of the number line and the
// shading needs to go all the way to the end of the number line.
const insetSize = this.options.displayedRangeInset - this.options.arrowSize;
const insetVector = model.numberLine.orientationProperty.value === Orientation.HORIZONTAL ?
const insetVector = ( model.numberLine.orientationProperty.value === Orientation.HORIZONTAL ) ?
new Vector2( insetSize, 0 ) :
new Vector2( 0, -insetSize );
const endPointPositionMin = model.numberLine.valueToModelPosition( displayedRange.min ).minus( insetVector );
Expand Down
2 changes: 1 addition & 1 deletion js/generic/model/NLDGenericModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class NLDGenericModel extends AbstractNLDBaseModel {

// change box bounds when number line orientation changes
this.numberLine.orientationProperty.link( orientation => {
this.pointControllerBoxProperty.value = orientation === Orientation.HORIZONTAL ?
this.pointControllerBoxProperty.value = ( orientation === Orientation.HORIZONTAL ) ?
NLDConstants.BOTTOM_BOX_BOUNDS :
NLDConstants.SIDE_BOX_BOUNDS;
} );
Expand Down

0 comments on commit b7035a0

Please sign in to comment.