- Timestamp:
- 2021-10-20T13:49:14+13:00 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/components/WordTimingSelector.vue
r35641 r35648 260 260 myWord(newValue, oldValue) { 261 261 if (newValue.id === oldValue.id && this.shadowWords.length > 0) { 262 console.log(`New: ${newValue.id} | Old: ${oldValue.id}`);263 262 return; 264 263 } 265 264 266 console.log("Updating");267 265 this.shadowWords = []; 268 266 for (const word of this.mySurroundingWords) { … … 295 293 }, 296 294 295 /** 296 * @param {KeyboardEvent} event 297 */ 298 onDocumentKeyDown(event) { 299 if (event.code === "Escape") { 300 this.onDocumentMouseUp(); // Cancel any edits that are in progress 301 this.emitWordUpdates(this.shadowWords); 302 } 303 }, 304 297 305 onDocumentMouseMove(event) { 298 306 if (this.canAdjustWordStartTime) { … … 313 321 this.adjustWordStartTime(event.movementX); 314 322 315 this. updateSurroundingWords();323 this.emitWordUpdates(this.mySurroundingWords); 316 324 }, 317 325 onMaxHandleMouseMove(event) { … … 322 330 this.adjustWordEndTime(event.movementX); 323 331 324 this. updateSurroundingWords();332 this.emitWordUpdates(this.mySurroundingWords); 325 333 }, 326 334 onDocumentMouseUp() { … … 420 428 }, 421 429 422 updateSurroundingWords() {423 for (let i = 0; i < this.mySurroundingWords.length; i++) {424 const updatedWord = this.convertMyWord( this.mySurroundingWords[i], this.surroundingWords[i]);430 emitWordUpdates(words) { 431 for (let i = 0; i < words.length; i++) { 432 const updatedWord = this.convertMyWord(words[i], this.surroundingWords[i]); 425 433 this.$emit("wordUpdated", i, updatedWord); 426 434 } … … 438 446 document.addEventListener("mousemove", this.onDocumentMouseMove); 439 447 document.addEventListener("mouseup", this.onDocumentMouseUp); 448 document.addEventListener("keydown", this.onDocumentKeyDown); 440 449 }, 441 450 beforeUnmount() { 442 451 document.removeEventListener("mousemove", this.onDocumentMouseMove); 443 452 document.removeEventListener("mouseup", this.onDocumentMouseUp); 453 document.removeEventListener("keydown", this.onDocumentKeyDown); 444 454 } 445 455 }
Note:
See TracChangeset
for help on using the changeset viewer.