Changeset 35537
- Timestamp:
- 2021-10-01T10:51:07+13:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/components/TranscriptionItemEditor.vue
r35528 r35537 186 186 log(event); 187 187 188 // https://rawgit.com/w3c/input-events/v1/index.html#interface-InputEvent-Attributes 188 189 const deletionEvents = [ 189 190 "deleteWordForward", "deleteWordBackward", … … 214 215 if (word.word.length === 0) { // Remove the word 215 216 this.setFocus(index, event.inputType === "deleteContentBackward"); // Shifting focus off an empty input, hence the word will be removed 216 event.preventDefault(); // Prevents the event from being propagated to the newly focused input217 217 // TODO: Shuffle timestamps 218 } 219 else if (inputIndex === 0 && event.inputType === "deleteContentBackward") { 220 // TODO: Join with previous 221 } 222 else if (inputIndex === word.word.length && event.inputType === "deleteContentForward") { 223 // TODO: Join with next 218 219 event.preventDefault(); 220 } 221 else if (inputIndex === 0 && event.inputType === "deleteContentBackward") { // Join with last word 222 if (index === 0) { 223 return; 224 } 225 else if (this.words.length > 1) { 226 this.words[index - 1].endTime = word.endTime; 227 this.words[index - 1].word += word.word; 228 229 word.word = ""; 230 this.setFocus(index, true); 231 } 232 233 event.preventDefault(); 234 } 235 else if (inputIndex === word.word.length && event.inputType === "deleteContentForward") { // Join with next word 236 if (index === this.words.length - 1) { 237 return; 238 } 239 else if (this.words.length > 1) { 240 this.words[index + 1].startTime = word.startTime; 241 this.words[index + 1].word = word.word + this.words[index + 1].word; 242 243 word.word = ""; 244 this.setFocus(index, false); 245 } 246 247 event.preventDefault(); 224 248 } 225 249 } … … 253 277 } 254 278 279 // Prevent the event from being propagated to the newly focused input 255 280 event.preventDefault(); 281 256 282 // Give the element time to be mounted before focusing 257 283 setTimeout(
Note:
See TracChangeset
for help on using the changeset viewer.