Remove synced motor label when motors are no longer in sync (#189)

This commit is contained in:
Sam El-Husseini 2018-01-05 10:54:42 -08:00 committed by Peli de Halleux
parent 2d3ea5631a
commit 76ff39605a

View File

@ -19,7 +19,11 @@ namespace pxsim.visuals {
const syncedMotor = motorState.getSynchedMotor();
if ((syncedMotor || this.syncedMotor) && syncedMotor != this.syncedMotor) {
this.syncedMotor = syncedMotor;
if (this.syncedMotor) {
this.showSyncedLabel(motorState, syncedMotor);
} else if (this.syncedLabelG) {
this.syncedLabelG.parentNode.removeChild(this.syncedLabelG);
}
}
}