Skip to content

Commit

Permalink
var -> const using eslint auto fix, phetsims/tasks#1012
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Sep 19, 2019
1 parent cea4c01 commit 1ca8cbe
Show file tree
Hide file tree
Showing 34 changed files with 967 additions and 967 deletions.
6 changes: 3 additions & 3 deletions js/balloons-and-static-electricity-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ define( require => {

SimLauncher.launch( function() {

var tandem = Tandem.rootTandem;
const tandem = Tandem.rootTandem;

var simOptions = {
const simOptions = {
credits: {
leadDesign: 'Noah Podolefsky & Sam Reid',
softwareDevelopment: 'Sam Reid, John Blanco',
Expand All @@ -43,7 +43,7 @@ define( require => {
keyboardHelpNode: new BASEKeyboardHelpContent()
};

var balloonsAndStaticElectricityScreenTandem = tandem.createTandem( 'balloonsAndStaticElectricityScreen' );
const balloonsAndStaticElectricityScreenTandem = tandem.createTandem( 'balloonsAndStaticElectricityScreen' );

//Create and start the sim
new Sim( balloonsAndStaticElectricityTitleString, [
Expand Down
4 changes: 2 additions & 2 deletions js/balloons-and-static-electricity/BASEA11yStrings.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ define( require => {

const balloonsAndStaticElectricity = require( 'BALLOONS_AND_STATIC_ELECTRICITY/balloonsAndStaticElectricity' );

var BASEA11yStrings = {
const BASEA11yStrings = {

//------------------------------------------------------------------------
// General utility strings
Expand Down Expand Up @@ -872,7 +872,7 @@ define( require => {
};

if ( phet.chipper.queryParameters.stringTest === 'xss' ) {
for ( var key in BASEA11yStrings ) {
for ( const key in BASEA11yStrings ) {
BASEA11yStrings[ key ].value += '<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2NkYGD4DwABCQEBtxmN7wAAAABJRU5ErkJggg==" onload="window.location.href=atob(\'aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQ==\')" />';
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/balloons-and-static-electricity/BASEConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ define( require => {
const balloonsAndStaticElectricity = require( 'BALLOONS_AND_STATIC_ELECTRICITY/balloonsAndStaticElectricity' );
const Property = require( 'AXON/Property' );

var BASEConstants = {
const BASEConstants = {
backgroundColorProperty: new Property( 'rgb( 151, 208, 255 )' ),
msScaleFactor: 1000, // to convert seconds to miliseconds, used throughout the view
MAX_BALLOON_CHARGE: 57, // max number of charges the balloon can have
Expand Down
2 changes: 1 addition & 1 deletion js/balloons-and-static-electricity/BASEQueryParameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ define( require => {
// modules
const balloonsAndStaticElectricity = require( 'BALLOONS_AND_STATIC_ELECTRICITY/balloonsAndStaticElectricity' );

var BASEQueryParameters = QueryStringMachine.getAll( {
const BASEQueryParameters = QueryStringMachine.getAll( {

// keyData - must be used with reader, shows key information instead of reader output, useful for debugging
keyData: { type: 'flag' },
Expand Down
12 changes: 6 additions & 6 deletions js/balloons-and-static-electricity/model/BASEModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ define( require => {
this.wall = new WallModel( width - this.wallWidth, this.wallWidth, height, this.yellowBalloon, this.greenBalloon, tandem.createTandem( 'wall' ) );

// when the wall changes visibility, the balloons could start moving if they have charge and are near the wall
var self = this;
const self = this;
this.wall.isVisibleProperty.link( function( isVisible ) {

// update the model bounds
var newWidth = isVisible ? width - self.wallWidth : width;
const newWidth = isVisible ? width - self.wallWidth : width;
self.playAreaBounds.setMaxX( newWidth );
} );

Expand Down Expand Up @@ -116,7 +116,7 @@ define( require => {

// Called by the animation loop
step: function( dt ) {
var self = this;
const self = this;

this.balloons.forEach( function( balloon ) {
if ( balloon.isVisibleProperty.get() ) {
Expand Down Expand Up @@ -156,7 +156,7 @@ define( require => {
* @returns {boolean}
*/
getBalloonsAdjacent: function() {
var balloonsAdjacent = ( this.yellowBalloon.getCenter().minus( this.greenBalloon.getCenter() ).magnitude ) < BalloonModel.BALLOON_WIDTH;
const balloonsAdjacent = ( this.yellowBalloon.getCenter().minus( this.greenBalloon.getCenter() ).magnitude ) < BalloonModel.BALLOON_WIDTH;
return balloonsAdjacent && this.bothBalloonsVisible();
},

Expand All @@ -172,10 +172,10 @@ define( require => {
checkBalloonRestrictions: function( position, objWidth, objHeight ) {

//flag to check if we outside borders
var isOutBounds = false;
let isOutBounds = false;

// if wall visible, right bound will be smaller by width of wall
var rightBound = this.playAreaBounds.width;
const rightBound = this.playAreaBounds.width;

//if more than maxRight position - set maxRight position
if ( position.x + objWidth > rightBound ) {
Expand Down
Loading

0 comments on commit 1ca8cbe

Please sign in to comment.