Skip to content

Commit

Permalink
minor refactors, #182
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Aug 28, 2023
1 parent 70d870e commit a068850
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/common/view/BANScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ abstract class BANScreenView<M extends BANModel<ParticleAtom | ParticleNucleus>>
if ( particleType === ParticleType.PROTON || particleType === ParticleType.NEUTRON ) {

// called when a nucleon is finished being dragged
particle.dragEndedEmitter.addListener( () => { this.dragEndedListener( particle, this.model.particleAtom ); } );
particle.dragEndedEmitter.addListener( () => this.dragEndedListener( particle, this.model.particleAtom ) );
this.checkIfCreatorNodeShouldBeInvisible( particleType );
}

Expand Down
4 changes: 2 additions & 2 deletions js/common/view/NucleonArrowButtons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ class NucleonArrowButtons extends Node {
const neutronNumber = atomNeutronNumber + incomingNeutronsNumber + userControlledNeutronNumber;
const userControlledNucleonNumber = userControlledNeutronNumber + userControlledProtonNumber;
const doesNuclideExist = AtomIdentifier.doesExist( protonNumber, neutronNumber );
const massNumber = atomProtonNumber + atomNeutronNumber;

// Disable all buttons if the nuclide doesn't exist and one of the two cases:
// Something is being user controlled OR Particle Atom is not empty
if ( !doesNuclideExist &&
( model.particleAtom.massNumberProperty.value !== 0 || userControlledNucleonNumber !== 0 ) ) {
if ( !doesNuclideExist && ( massNumber !== 0 || userControlledNucleonNumber !== 0 ) ) {

// disable all arrow buttons if the nuclide does not exist
NucleonArrowButtons.toggleCreatorNodeEnabled( protonsCreatorNode, false );
Expand Down

0 comments on commit a068850

Please sign in to comment.