Skip to content

Commit

Permalink
update description of light spectrum dialog, see #245
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Apr 21, 2021
1 parent a1640ab commit d71d8ab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
10 changes: 1 addition & 9 deletions js/moleculesandlight/view/LightSpectrumDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ define( require => {
const Dialog = require( 'SUN/Dialog' );
const inherit = require( 'PHET_CORE/inherit' );
const moleculesAndLight = require( 'MOLECULES_AND_LIGHT/moleculesAndLight' );
const MoleculesAndLightA11yStrings = require( 'MOLECULES_AND_LIGHT/common/MoleculesAndLightA11yStrings' );

// a11y string
const spectrumWindowDescriptionString = MoleculesAndLightA11yStrings.spectrumWindowDescriptionString.value;

/**
* @constructor
Expand All @@ -34,11 +30,7 @@ define( require => {

// phet-io
tandem: tandem,
phetioDynamicElement: true,

// a11y
tagName: 'p',
descriptionContent: spectrumWindowDescriptionString
phetioDynamicElement: true
} );
}

Expand Down
18 changes: 17 additions & 1 deletion js/moleculesandlight/view/SpectrumDiagram.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ define( require => {
const Util = require( 'DOT/Util' );
const Vector2 = require( 'DOT/Vector2' );
const WavelengthSpectrumNode = require( 'SCENERY_PHET/WavelengthSpectrumNode' );
const MoleculesAndLightA11yStrings = require( 'MOLECULES_AND_LIGHT/common/MoleculesAndLightA11yStrings' );

// strings
const spectrumWindowCyclesPerSecondUnitsString = require( 'string!MOLECULES_AND_LIGHT/SpectrumWindow.cyclesPerSecondUnits' );
Expand All @@ -43,6 +44,9 @@ define( require => {
const spectrumWindowWavelengthArrowLabelString = require( 'string!MOLECULES_AND_LIGHT/SpectrumWindow.wavelengthArrowLabel' );
const spectrumWindowXrayBandLabelString = require( 'string!MOLECULES_AND_LIGHT/SpectrumWindow.xrayBandLabel' );

// PDOM strings
const spectrumDialogDescriptionString = MoleculesAndLightA11yStrings.spectrumDialogDescriptionString.value;

// shared constants
const LABEL_FONT = new PhetFont( 16 );
const SUBSECTION_WIDTH = 490; // width of each subsection on the window (arrows, chirp node, and labeled diagram).
Expand Down Expand Up @@ -108,7 +112,19 @@ define( require => {
const decreasingWavelengthNode = new ChirpNode();
children.push( decreasingWavelengthNode );

LayoutBox.call( this, { orientation: 'vertical', children: children, spacing: 15 } );
LayoutBox.call( this, {
orientation: 'vertical',
children: children,
spacing: 15,

// PDOM
containerTagName: 'div',
tagName: 'h1',
innerContent: spectrumWindowTitleString,
descriptionTagName: 'p',
descriptionContent: spectrumDialogDescriptionString,
appendDescription: true
} );
}

moleculesAndLight.register( 'SpectrumDiagram', SpectrumDiagram );
Expand Down

0 comments on commit d71d8ab

Please sign in to comment.