Skip to content

Commit

Permalink
Adding visiblePropertyOptions to PhetButton/PhetMenu, so that the API…
Browse files Browse the repository at this point in the history
… is unchanged, we'll want read-only in the future, see phetsims/scenery#1046
  • Loading branch information
jonathanolson committed Apr 17, 2020
1 parent cd7d9a3 commit 6a40608
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
13 changes: 10 additions & 3 deletions js/PhetButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ import Property from '../../axon/js/Property.js';
import inherit from '../../phet-core/js/inherit.js';
import Image from '../../scenery/js/nodes/Image.js';
import Node from '../../scenery/js/nodes/Node.js';
import joist from './joist.js';
import joistStrings from './joistStrings.js';
import Tandem from '../../tandem/js/Tandem.js';
import JoistButton from './JoistButton.js';
import KebabMenuIcon from './KebabMenuIcon.js';
import PhetButtonIO from './PhetButtonIO.js';
import PhetMenu from './PhetMenu.js';
import updateCheck from './updateCheck.js';
import UpdateState from './UpdateState.js';
import joist from './joist.js';
import joistStrings from './joistStrings.js';
import updateCheck from './updateCheck.js';

// Accommodate logos of any height by scaling them down proportionately.
// The primary logo is 108px high and we have been scaling it at 0.28 to make it look good even on higher resolution
Expand Down Expand Up @@ -95,6 +96,12 @@ function PhetButton( sim, backgroundFillProperty, tandem ) {
phetioFeatured: true
},

visiblePropertyOptions: {
// TODO: Shouldn't it be read-only instead of uninstrumented? See https://github.com/phetsims/scenery/issues/1046
tandem: Tandem.OPT_OUT,
phetioReadOnly: true
},

// pdom
tagName: 'button',
innerContent: joistStrings.a11y.phetMenu
Expand Down
15 changes: 11 additions & 4 deletions js/PhetMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import openPopup from '../../phet-core/js/openPopup.js';
import platform from '../../phet-core/js/platform.js';
import stripEmbeddingMarks from '../../phet-core/js/stripEmbeddingMarks.js';
import PhetFont from '../../scenery-phet/js/PhetFont.js';
import PDOMUtils from '../../scenery/js/accessibility/pdom/PDOMUtils.js';
import KeyboardUtils from '../../scenery/js/accessibility/KeyboardUtils.js';
import PDOMUtils from '../../scenery/js/accessibility/pdom/PDOMUtils.js';
import Display from '../../scenery/js/display/Display.js';
import Node from '../../scenery/js/nodes/Node.js';
import Path from '../../scenery/js/nodes/Path.js';
Expand All @@ -28,15 +28,16 @@ import MenuItem from '../../sun/js/MenuItem.js';
import soundManager from '../../tambo/js/soundManager.js';
import PhetioCapsule from '../../tandem/js/PhetioCapsule.js';
import PhetioCapsuleIO from '../../tandem/js/PhetioCapsuleIO.js';
import Tandem from '../../tandem/js/Tandem.js';
import AboutDialog from './AboutDialog.js';
import joistStrings from './joistStrings.js';
import joist from './joist.js';
import OptionsDialog from './OptionsDialog.js';
import PhetMenuIO from './PhetMenuIO.js';
import ScreenshotGenerator from './ScreenshotGenerator.js';
import updateCheck from './updateCheck.js';
import UpdateDialog from './UpdateDialog.js';
import UpdateState from './UpdateState.js';
import joist from './joist.js';
import joistStrings from './joistStrings.js';
import updateCheck from './updateCheck.js';

const menuItemAboutString = joistStrings.menuItem.about;
const menuItemEnhancedSoundString = joistStrings.menuItem.enhancedSound;
Expand Down Expand Up @@ -106,6 +107,12 @@ function PhetMenu( sim, phetButton, tandem, options ) {
phetioState: false,
phetioDocumentation: 'This menu is displayed when the PhET button is pressed.',

visiblePropertyOptions: {
// TODO: Shouldn't it be read-only instead of uninstrumented? See https://github.com/phetsims/scenery/issues/1046
tandem: Tandem.OPT_OUT,
phetioReadOnly: true
},

// pdom, tagname and role for content in the menu
tagName: 'ul',
ariaRole: 'menu'
Expand Down

0 comments on commit 6a40608

Please sign in to comment.