diff options
| -rw-r--r-- | fretboard.mjs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fretboard.mjs b/fretboard.mjs index 017d273..d3671f0 100644 --- a/fretboard.mjs +++ b/fretboard.mjs @@ -49,7 +49,7 @@ export default class extends HTMLElement { connectedCallback() { console.debug('Fretboard#connectedCallback', this); - const postEvent = (elt, eventName) => { + const postEvent = eventName => { const res = (e) => { e.preventDefault(); const event = new CustomEvent(eventName, { @@ -61,14 +61,14 @@ export default class extends HTMLElement { }; return res.bind(this); } - this.querySelectorAll('.save').forEach(elt => elt.onclick = postEvent(elt, this.saveEvent)); + this.querySelectorAll('.save').forEach(elt => elt.onclick = postEvent(this.saveEvent)); this.querySelectorAll('.play').forEach(elt => elt.onclick = e => { if (this.isPlaying) { - (postEvent(elt, this.stopEvent))(e); + (postEvent(this.stopEvent))(e); elt.innerText = '▶️ play'; this.isPlaying = false; } else { - (postEvent(elt, this.playEvent))(e); + (postEvent(this.playEvent))(e); elt.innerText = '⏹️ stop'; this.isPlaying = true; } |
