feat: add improve name button
This commit is contained in:
@ -19,8 +19,20 @@ export class Track {
|
||||
this.row.dataset.i = this.idx
|
||||
this.table.fields.forEach(field => {
|
||||
const td = this.row.insertCell(-1)
|
||||
const input = this.makeInput(field, this.fields[field.key], this.idx)
|
||||
const input = this.makeInput(field, this.fields[field.key])
|
||||
td.appendChild(input)
|
||||
|
||||
if (field.key === "name") {
|
||||
const btn = document.getElementById("improve-btn").cloneNode(true)
|
||||
btn.id = null
|
||||
btn.classList.remove("template")
|
||||
btn.addEventListener("click", () => {
|
||||
this.improveName()
|
||||
btn.classList.add("clicked")
|
||||
setTimeout(() => btn.classList.remove("clicked"), 1000)
|
||||
})
|
||||
td.appendChild(btn)
|
||||
}
|
||||
})
|
||||
return this.row
|
||||
}
|
||||
@ -111,6 +123,10 @@ export class Track {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
improveName() {
|
||||
this.table.editor.integrity_mgr.improveName(this)
|
||||
}
|
||||
}
|
||||
|
||||
export default class TracksTable {
|
||||
|
Reference in New Issue
Block a user