Update
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user