ydshieh HF staff commited on
Commit
46ba573
1 Parent(s): dd8cf60

Update transcript-tracer.js

Browse files
Files changed (1) hide show
  1. transcript-tracer.js +3 -0
transcript-tracer.js CHANGED
@@ -468,6 +468,9 @@ function handleWordClick(e) {
468
  if (!ttCurrentTranscript || ttCurrentTranscript.dataset.ttTranscript != ttData.transcriptIndex) {
469
  ttCurrentTranscript = document.querySelector(`[data-tt-transcript="${ttData.transcriptIndex}"]`);
470
  }
 
 
 
471
 
472
  // Mark words
473
  wordElement.classList.add('tt-current-word');
 
468
  if (!ttCurrentTranscript || ttCurrentTranscript.dataset.ttTranscript != ttData.transcriptIndex) {
469
  ttCurrentTranscript = document.querySelector(`[data-tt-transcript="${ttData.transcriptIndex}"]`);
470
  }
471
+
472
+ // Clear words that were highlighted from the previous event
473
+ clearHighlightedWords(ttCurrentTranscript);
474
 
475
  // Mark words
476
  wordElement.classList.add('tt-current-word');