Skip to content

Commit

Permalink
remove default disabled visuals in Node, move to SunConstants.getComp…
Browse files Browse the repository at this point in the history
…onentEnabledListener(), phetsims/scenery#1112
  • Loading branch information
zepumph committed Nov 6, 2020
1 parent ef1a346 commit 91c48dc
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions js/common/view/SliderKnob.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ function SliderKnob( tandem, options ) {
this.addChild( rectangle );

// @private - link the fill to the enabled property. Slider knob exists for lifetime of sim, no dispose necessary.
this.enabledPropertyListener = function( enabled ) {
this.enabledProperty.link( enabled => {
rectangle.fill = enabled ? enabledGradient : disabledGradient;
};
} );

//add a grid of grip dots
const dx = width / 5;
Expand All @@ -72,16 +72,6 @@ forcesAndMotionBasics.register( 'SliderKnob', SliderKnob );

inherit( Node, SliderKnob, {

/**
* This type implemented enabled differently from the default, so support that here.
* @protected
* @override
* @param {boolean} enabled
*/
onEnabledPropertyChange: function( enabled ) {
this.enabledPropertyListener( enabled );
},

/**
* @private
* @param {number} x
Expand Down

0 comments on commit 91c48dc

Please sign in to comment.