This commit is contained in:
P-A
2026-02-06 23:37:58 +01:00
parent 16393b221f
commit 0f28082e46
2 changed files with 23 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
class HomeworkVocabularyTask extends HomeworkElement {
constructor () {
constructor (id) {
super()
this.innerHTML =
`
@@ -9,6 +9,7 @@ class HomeworkVocabularyTask extends HomeworkElement {
<img src="/images/check-circle.svg" class="disabled">
<img src="/images/times-circle.svg" class="disabled">
`
this.id = id
this.setAttribute("result", "unknown")
this.setAttribute("state", "edit")
this.deleteButton = this.querySelector('img#delete')
@@ -21,6 +22,11 @@ class HomeworkVocabularyTask extends HomeworkElement {
deleteTask() {
console.log("Delete line")
this.dispatchEvent(new CustomEvent("delete", {detail:{id: this.id}, bubbles: true, cancelable: true}))
}
getId() {
return this.id
}
}
customElements.define('homework-vocabulary-task', HomeworkVocabularyTask)