Skip to content

Commit

Permalink
do not set visibleProperty for plots and alleles when restoring PhET-…
Browse files Browse the repository at this point in the history
…iO state, #314
  • Loading branch information
pixelzoom committed Jul 12, 2022
1 parent a4cd683 commit 26b9fe0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
18 changes: 12 additions & 6 deletions js/common/model/PopulationModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,22 @@ class PopulationModel extends PhetioObject {
// When a mutation has been applied, show the plots associated with that gene.
// unlinks are not necessary.
this.genePool.furGene.dominantAlleleProperty.link( dominantAllele => {
this.whiteFurVisibleProperty.value = !!dominantAllele;
this.brownFurVisibleProperty.value = !!dominantAllele;
if ( !phet.joist.sim.isSettingPhetioStateProperty.value ) {
this.whiteFurVisibleProperty.value = !!dominantAllele;
this.brownFurVisibleProperty.value = !!dominantAllele;
}
} );
this.genePool.earsGene.dominantAlleleProperty.link( dominantAllele => {
this.straightEarsVisibleProperty.value = !!dominantAllele;
this.floppyEarsVisibleProperty.value = !!dominantAllele;
if ( !phet.joist.sim.isSettingPhetioStateProperty.value ) {
this.straightEarsVisibleProperty.value = !!dominantAllele;
this.floppyEarsVisibleProperty.value = !!dominantAllele;
}
} );
this.genePool.teethGene.dominantAlleleProperty.link( dominantAllele => {
this.shortTeethVisibleProperty.value = !!dominantAllele;
this.longTeethVisibleProperty.value = !!dominantAllele;
if ( !phet.joist.sim.isSettingPhetioStateProperty.value ) {
this.shortTeethVisibleProperty.value = !!dominantAllele;
this.longTeethVisibleProperty.value = !!dominantAllele;
}
} );
}

Expand Down
4 changes: 3 additions & 1 deletion js/common/view/pedigree/AllelesPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ class Row extends VBox {

// Automatically make the alleles visible.
// Corresponding alleles should not be visible when the row is disabled.
visibleProperty.value = hasMutation;
if ( !phet.joist.sim.isSettingPhetioStateProperty.value ) {
visibleProperty.value = hasMutation;
}

if ( dominantAllele ) {

Expand Down

0 comments on commit 26b9fe0

Please sign in to comment.