feat: add improve name button

This commit is contained in:
2025-04-30 11:33:55 +02:00
committed by Louis Heredero
parent 52267d16e3
commit 609b32d09a
8 changed files with 323 additions and 22 deletions

View File

@ -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 {