Skip to content

Commit

Permalink
Add ability to remove people with query parameter 'people', see #96
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisklus committed Jan 17, 2020
1 parent dd17047 commit 0c7c4f3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
26 changes: 26 additions & 0 deletions js/common/BAQueryParameters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2020, University of Colorado Boulder

/**
* Query parameters for Balancing Act
*
* @author Sam Reid (PhET Interactive Simulations)
* @author Chris Klusendorf (PhET Interactive Simulations)
*/
define( require => {
'use strict';

// modules
const balancingAct = require( 'BALANCING_ACT/balancingAct' );

const BAQueryParameters = QueryStringMachine.getAll( {

// whether the people are visible in MassKitSelectionNode
people: {
type: 'boolean',
defaultValue: true
}
} );

balancingAct.register( 'BAQueryParameters', BAQueryParameters );
return BAQueryParameters;
} );
11 changes: 6 additions & 5 deletions js/common/view/MassKitSelectionNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ define( require => {

// modules
const balancingAct = require( 'BALANCING_ACT/balancingAct' );
const BAQueryParameters = require( 'BALANCING_ACT/common/BAQueryParameters' );
const BoyCreatorNode = require( 'BALANCING_ACT/balancelab/view/BoyCreatorNode' );
const bricksString = require( 'string!BALANCING_ACT/bricks' );
const BrickStackCreatorNode = require( 'BALANCING_ACT/balancelab/view/BrickStackCreatorNode' );
Expand Down Expand Up @@ -161,14 +162,14 @@ define( require => {
title: new Text( bricksString, { font: TITLE_FONT } ),
content: brickCreatorKit
},
{
...BAQueryParameters.people ? [ {
title: new Text( peopleString, { font: TITLE_FONT } ),
content: peopleKit1
},
{
title: new Text( peopleString, { font: TITLE_FONT } ),
content: peopleKit2
},
{
title: new Text( peopleString, { font: TITLE_FONT } ),
content: peopleKit2
} ] : [],
{
title: new Text( mysteryObjectsString, { font: TITLE_FONT } ),
content: mysteryMassesKit1
Expand Down

0 comments on commit 0c7c4f3

Please sign in to comment.