From 76ff39605ae0edd5d7fe74c9b3f7375b61645bb1 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini <16690124+samelhusseini@users.noreply.github.com> Date: Fri, 5 Jan 2018 10:54:42 -0800 Subject: [PATCH] Remove synced motor label when motors are no longer in sync (#189) --- sim/visuals/nodes/largeMotorView.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sim/visuals/nodes/largeMotorView.ts b/sim/visuals/nodes/largeMotorView.ts index 3f18241a..292b28ff 100644 --- a/sim/visuals/nodes/largeMotorView.ts +++ b/sim/visuals/nodes/largeMotorView.ts @@ -19,7 +19,11 @@ namespace pxsim.visuals { const syncedMotor = motorState.getSynchedMotor(); if ((syncedMotor || this.syncedMotor) && syncedMotor != this.syncedMotor) { this.syncedMotor = syncedMotor; - this.showSyncedLabel(motorState, syncedMotor); + if (this.syncedMotor) { + this.showSyncedLabel(motorState, syncedMotor); + } else if (this.syncedLabelG) { + this.syncedLabelG.parentNode.removeChild(this.syncedLabelG); + } } }