diff --git a/js/moleculesandlight/view/LightSpectrumDialog.js b/js/moleculesandlight/view/LightSpectrumDialog.js index ab8dbc39..93762b17 100644 --- a/js/moleculesandlight/view/LightSpectrumDialog.js +++ b/js/moleculesandlight/view/LightSpectrumDialog.js @@ -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 @@ -34,11 +30,7 @@ define( require => { // phet-io tandem: tandem, - phetioDynamicElement: true, - - // a11y - tagName: 'p', - descriptionContent: spectrumWindowDescriptionString + phetioDynamicElement: true } ); } diff --git a/js/moleculesandlight/view/SpectrumDiagram.js b/js/moleculesandlight/view/SpectrumDiagram.js index e7618606..a32b141c 100644 --- a/js/moleculesandlight/view/SpectrumDiagram.js +++ b/js/moleculesandlight/view/SpectrumDiagram.js @@ -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' ); @@ -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). @@ -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 );