debug
This commit is contained in:
parent
20f0dbb1ae
commit
f875e1fbc9
1 changed files with 4 additions and 2 deletions
|
@ -59,12 +59,12 @@ const main = (): void => {
|
||||||
// eslint-disable-next-line prefer-const
|
// eslint-disable-next-line prefer-const
|
||||||
let score: any
|
let score: any
|
||||||
const destroy = (): void => {
|
const destroy = (): void => {
|
||||||
score.destroy()
|
score && score.destroy()
|
||||||
w.close()
|
w.close()
|
||||||
}
|
}
|
||||||
window.addEventListener('unload', destroy)
|
window.addEventListener('unload', destroy)
|
||||||
w.addEventListener('beforeunload', () => {
|
w.addEventListener('beforeunload', () => {
|
||||||
score.destroy()
|
score && score.destroy()
|
||||||
window.removeEventListener('unload', destroy)
|
window.removeEventListener('unload', destroy)
|
||||||
setText(btnName)
|
setText(btnName)
|
||||||
btn.onclick = _onclick
|
btn.onclick = _onclick
|
||||||
|
@ -88,11 +88,13 @@ const main = (): void => {
|
||||||
// render the part selection page
|
// render the part selection page
|
||||||
txt.remove()
|
txt.remove()
|
||||||
const fieldset = w.document.createElement('fieldset')
|
const fieldset = w.document.createElement('fieldset')
|
||||||
|
metadata.excerpts.unshift({ id: -1, title: 'Full score' })
|
||||||
for (const excerpt of metadata.excerpts) {
|
for (const excerpt of metadata.excerpts) {
|
||||||
const e = w.document.createElement('input')
|
const e = w.document.createElement('input')
|
||||||
e.name = 'score-part'
|
e.name = 'score-part'
|
||||||
e.type = 'radio'
|
e.type = 'radio'
|
||||||
e.value = excerpt.id
|
e.value = excerpt.id
|
||||||
|
e.checked = excerpt.id === 0 // initially select the first part
|
||||||
const label = w.document.createElement('label')
|
const label = w.document.createElement('label')
|
||||||
label.innerText = excerpt.title
|
label.innerText = excerpt.title
|
||||||
const br = w.document.createElement('br')
|
const br = w.document.createElement('br')
|
||||||
|
|
Loading…
Reference in a new issue