Skip to content

Commit

Permalink
refactor children in CL, phetsims/gravity-force-lab#104
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Nov 18, 2019
1 parent 695f0a2 commit f10e3b2
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions js/common/view/CoulombsLawCommonView.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ define( require => {
'moveOnHoldDelay',
'moveOnHoldInterval'
] ) );
this.addChild( coulombsLawRuler );

// construct checkbox item list
const checkboxItems = [
Expand All @@ -109,8 +108,6 @@ define( require => {
bottom: bottomAlignment - 73
} );

this.addChild( coulombsLawParameterCheckbox );

const charge1Control = new ChargeControl(
charge1String,
unitString,
Expand All @@ -122,8 +119,6 @@ define( require => {
charge1Control.right = this.layoutBounds.centerX - 5;
charge1Control.top = coulombsLawParameterCheckbox.top;

this.addChild( charge1Control );

const charge2Control = new ChargeControl(
charge2String,
unitString,
Expand All @@ -138,8 +133,6 @@ define( require => {
charge2Control.left = this.layoutBounds.centerX + 5;
charge2Control.top = coulombsLawParameterCheckbox.top;

this.addChild( charge2Control );

// Reset All button
// buttons are never disposed in this sim
const resetAllButton = new ResetAllButton( {
Expand All @@ -154,7 +147,16 @@ define( require => {
bottom: bottomAlignment,
tandem: tandem.createTandem( 'resetAllButton' )
} );
this.addChild( resetAllButton );

this.children = [
coulombsLawRuler,
coulombsLawParameterCheckbox,
charge1Control,
charge2Control,


resetAllButton
];

// a11y - accessible order of controls, charge objects will come first in subtypes
this.pdomPlayAreaNode.accessibleOrder = [
Expand Down

0 comments on commit f10e3b2

Please sign in to comment.