Skip to content

Commit

Permalink
Minor cleanup, inline some variables, see #123
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jun 4, 2024
1 parent 7d59664 commit d1152be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
1 change: 0 additions & 1 deletion js/buoyancy/view/DensityAccordionBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export default class DensityAccordionBox extends ReadoutListAccordionBox<Density
} );
} );


this.cleanupEmitter.addListener( () => {
nameProperty.dispose();
valueProperty.dispose();
Expand Down
3 changes: 1 addition & 2 deletions js/buoyancy/view/FluidSelectionPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,10 @@ export default class FluidSelectionPanel extends Panel {
align: 'left'
} ), DensityBuoyancyCommonConstants.PANEL_OPTIONS );

liquidMaterialProperty instanceof ReadOnlyProperty && this.addLinkedElement( liquidMaterialProperty, {
this.addLinkedElement( liquidMaterialProperty, {
tandem: comboBoxTandem.createTandem( 'property' )
} );
}

}

densityBuoyancyCommon.register( 'FluidSelectionPanel', FluidSelectionPanel );
12 changes: 4 additions & 8 deletions js/buoyancy/view/SubmergedAccordionBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@ import DensityBuoyancyCommonPreferences from '../../common/model/DensityBuoyancy
import Mass from '../../common/model/Mass.js';
import PatternStringProperty from '../../../../axon/js/PatternStringProperty.js';

type SubmergedReadoutType = Mass;
export default class SubmergedAccordionBox extends ReadoutListAccordionBox<Mass> {

export default class SubmergedAccordionBox extends ReadoutListAccordionBox<SubmergedReadoutType> {
public constructor( providedOptions?: ReadoutListAccordionBoxOptions<Mass> ) {

public constructor(
providedOptions?: ReadoutListAccordionBoxOptions<SubmergedReadoutType>
) {

const options = combineOptions<ReadoutListAccordionBoxOptions<SubmergedReadoutType>>( {
const options = combineOptions<ReadoutListAccordionBoxOptions<Mass>>( {
visibleProperty: DensityBuoyancyCommonPreferences.percentageSubmergedVisibleProperty,
readoutItems: [],
expandedDefaultValue: false,
Expand All @@ -34,7 +30,7 @@ export default class SubmergedAccordionBox extends ReadoutListAccordionBox<Subme
super( DensityBuoyancyCommonStrings.percentSubmergedStringProperty, options );
}

public override generateReadoutData( mass: SubmergedReadoutType ): ReadoutData {
public override generateReadoutData( mass: Mass ): ReadoutData {

return {
nameProperty: mass.nameProperty,
Expand Down

0 comments on commit d1152be

Please sign in to comment.