Skip to content

Commit

Permalink
use isDisposable: false instead of overridden dispose methods, phet…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jul 10, 2023
1 parent 8147cc9 commit 8295f4f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 23 deletions.
7 changes: 2 additions & 5 deletions js/view/BatteryReverseButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,11 @@ export default class BatteryReverseButton extends CCKCRoundPushButton {
else {
assert && assert( false, 'selected circuit element should have been a battery' );
}
}
},
isDisposable: false
}, providedOptions );
super( options );
}

public override dispose(): void {
assert && assert( false, 'should not be disposed' );
}
}

circuitConstructionKitCommon.register( 'BatteryReverseButton', BatteryReverseButton );
5 changes: 1 addition & 4 deletions js/view/CCKCTrashButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,10 @@ export default class CCKCTrashButton extends CCKCRoundPushButton {
}
}
},
isDisposable: false,
tandem: tandem
}, providedOptions ) );
}

public override dispose(): void {
assert && assert( false, 'should not be disposed' );
}
}

circuitConstructionKitCommon.register( 'CCKCTrashButton', CCKCTrashButton );
5 changes: 1 addition & 4 deletions js/view/CircuitElementNumberControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export default class CircuitElementNumberControl extends HBox {
trackSize: new Dimension2( 120, 4 )
},
tandem: Tandem.OPT_OUT,
isDisposable: false,
getAdditionalVisibilityProperties: ( c: CircuitElement ) => {return [];}
}, providedOptions );
const numberControl = new NumberControl( title, valueProperty, range, options );
Expand All @@ -99,10 +100,6 @@ export default class CircuitElementNumberControl extends HBox {
}
} );
}

public override dispose(): void {
assert && assert( false, 'Should not be disposed' );
}
}

circuitConstructionKitCommon.register( 'CircuitElementNumberControl', CircuitElementNumberControl );
7 changes: 2 additions & 5 deletions js/view/ClearDynamicsButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export default class ClearDynamicsButton extends CCKCRoundPushButton {
if ( dynamicCircuitElement instanceof DynamicCircuitElement ) {
dynamicCircuitElement.clear();
}
}
},
isDisposable: false
}, providedOptions );

super( options );
Expand All @@ -72,10 +73,6 @@ export default class ClearDynamicsButton extends CCKCRoundPushButton {
newCircuitElement instanceof DynamicCircuitElement && newCircuitElement.isClearableProperty.link( isClearableListener );
} );
}

public override dispose(): void {
assert && assert( false, 'should not be disposed' );
}
}

circuitConstructionKitCommon.register( 'ClearDynamicsButton', ClearDynamicsButton );
7 changes: 2 additions & 5 deletions js/view/FuseRepairButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export default class FuseRepairButton extends CCKCRoundPushButton {
fuse.resetFuse();
circuit.componentEditedEmitter.emit();
}
}
},
isDisposable: false
}, providedOptions );

super( options );
Expand All @@ -65,10 +66,6 @@ export default class FuseRepairButton extends CCKCRoundPushButton {
newCircuitElement instanceof Fuse && newCircuitElement.isTrippedProperty.link( isTrippedListener );
} );
}

public override dispose(): void {
assert && assert( false, 'should not be disposed' );
}
}

circuitConstructionKitCommon.register( 'FuseRepairButton', FuseRepairButton );

0 comments on commit 8295f4f

Please sign in to comment.