Skip to content

Commit

Permalink
convert components to use Node.enabledProperty instead of EnabledNode,
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Oct 30, 2020
1 parent 68b89f9 commit cc1dffe
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions js/common/view/NaturalSelectionTimeControlNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import AssertUtils from '../../../../phetcommon/js/AssertUtils.js';
import PlayPauseButton from '../../../../scenery-phet/js/buttons/PlayPauseButton.js';
import TimeSpeed from '../../../../scenery-phet/js/TimeSpeed.js';
import HBox from '../../../../scenery/js/nodes/HBox.js';
import EnabledNode from '../../../../sun/js/EnabledNode.js';
import Tandem from '../../../../tandem/js/Tandem.js';
import naturalSelection from '../../naturalSelection.js';
import FastForwardButton from './FastForwardButton.js';
Expand All @@ -29,7 +28,6 @@ class NaturalSelectionTimeControlNode extends HBox {
* @param {Property.<boolean>} isPlayingProperty
* @param {EnumerationProperty.<TimeSpeed>} timeSpeedProperty
* @param {Object} [options]
* @mixes EnabledNode
*/
constructor( isPlayingProperty, timeSpeedProperty, options ) {

Expand All @@ -40,7 +38,8 @@ class NaturalSelectionTimeControlNode extends HBox {
spacing: 10,

// phet-io
tandem: Tandem.REQUIRED
tandem: Tandem.REQUIRED,
enabledPropertyPhetioInstrumented: true // opt into default PhET-iO instrumented enabledProperty
}, options );

const playPauseButton = new PlayPauseButton( isPlayingProperty, {
Expand All @@ -59,7 +58,6 @@ class NaturalSelectionTimeControlNode extends HBox {
options.children = [ playPauseButton, fastForwardButton ];

super( options );
this.initializeEnabledNode( options );

// Save state of whether the sim is playing, so it can be restored when fast-forward is released.
let isPlayingSaved = isPlayingProperty.value;
Expand Down Expand Up @@ -93,8 +91,5 @@ class NaturalSelectionTimeControlNode extends HBox {
}
}

// mix in enabled component into a Node
EnabledNode.mixInto( NaturalSelectionTimeControlNode );

naturalSelection.register( 'NaturalSelectionTimeControlNode', NaturalSelectionTimeControlNode );
export default NaturalSelectionTimeControlNode;

0 comments on commit cc1dffe

Please sign in to comment.