Skip to content

Commit

Permalink
convert Voicing to typescript and the new mixin pattern, phetsims/sce…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jan 26, 2022
1 parent 801ab4c commit 409096b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
7 changes: 1 addition & 6 deletions js/view/DistanceArrowNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const distanceArrowReadingBlockContentString = gravityForceLabBasicsStrings.a11y
const HEAD_WIDTH = 8;
const HEAD_HEIGHT = 8;

class DistanceArrowNode extends Node {
class DistanceArrowNode extends ReadingBlock( Node ) {

/**
* @mixes {ReadingBlock}
Expand All @@ -46,9 +46,6 @@ class DistanceArrowNode extends Node {

super();

// voicing - initialize the trait
this.initializeReadingBlock();

const arrowNode = new ArrowNode( model.object1.positionProperty.get(), 0,
model.object2.positionProperty.get(), 0, {
doubleHead: true,
Expand Down Expand Up @@ -98,7 +95,5 @@ class DistanceArrowNode extends Node {
}
}

ReadingBlock.compose( DistanceArrowNode );

gravityForceLabBasics.register( 'DistanceArrowNode', DistanceArrowNode );
export default DistanceArrowNode;
6 changes: 1 addition & 5 deletions js/view/GFLBMassControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ gravityForceLabBasics.register( 'GFLBMassControl', GFLBMassControl );
* An inner class for the mass contents surrounding the NumberPicker (title, readout) that can be activated
* to get the current value and any other help content provided by Voicing.
*/
class MassControlReadingBlock extends VBox {
class MassControlReadingBlock extends ReadingBlock( VBox ) {

/**
* @mixes {ReadingBlock}
Expand All @@ -165,14 +165,10 @@ class MassControlReadingBlock extends VBox {
}, options );

super();
this.initializeReadingBlock();

this.mutate( options );
}
}

ReadingBlock.compose( MassControlReadingBlock );


/**
* An inner class that implements the Voicing for the NumberPicker. Eventually this could be moved to NumberPicker,
Expand Down

0 comments on commit 409096b

Please sign in to comment.