feat: individual parts default to "full score"

This commit is contained in:
Xmader 2020-11-09 14:04:18 -05:00
parent cb3bca3566
commit 6a767ea7ae
No known key found for this signature in database
GPG key ID: A20B97FB9EB730E4

View file

@ -103,6 +103,7 @@ const main = (): void => {
]
// part selection
const DEFAULT_PART = -1 // initially select "full score"
for (const excerpt of metadata.excerpts) {
const id = excerpt.id
const partName = excerpt.title
@ -111,7 +112,7 @@ const main = (): void => {
e.name = 'score-part'
e.type = 'radio'
e.alt = partName
e.checked = id === 0 // initially select the first part
e.checked = id === DEFAULT_PART
e.onclick = () => {
return score.setExcerptId(id) // set selected part
}
@ -123,7 +124,7 @@ const main = (): void => {
fieldset.append(e, label, br)
}
await score.setExcerptId(0) // initially select the first part
await score.setExcerptId(DEFAULT_PART)
// submit buttons
for (const d of downloads) {