Introduced clear all button

This commit is contained in:
P-A
2026-02-08 16:49:38 +01:00
parent b38979a7a9
commit f69ae46d26
3 changed files with 28 additions and 5 deletions

View File

@@ -14,6 +14,8 @@ class HomeworkVocabularyTask extends HomeworkElement {
this.setAttribute("state", "edit")
this.deleteButton = this.querySelector('img#delete')
this.deleteButton.addEventListener("click", this.deleteTask.bind(this))
this.sourceText = this.querySelector("input#source")
this.targetText = this.querySelector("input#target")
}
connectedCallback() {
@@ -28,5 +30,13 @@ class HomeworkVocabularyTask extends HomeworkElement {
getId() {
return this.id
}
setSourceText(text) {
this.sourceText.value = text
}
setTargetText(text) {
this.targetText.value = text
}
}
customElements.define('homework-vocabulary-task', HomeworkVocabularyTask)