diff options
| author | Brian Cully <bjc@spork.org> | 2025-07-28 08:52:51 -0400 |
|---|---|---|
| committer | Brian Cully <bjc@spork.org> | 2025-07-28 08:52:51 -0400 |
| commit | 77f5e81d0a1adc497040eaa89095635f3de3924e (patch) | |
| tree | 4ad6a00edf5cfe3c5c2bf0090ba80f8d13c143cc /tests.mjs | |
| parent | 2d12e407ccac850dd2e1ce133a2f335677a2ef29 (diff) | |
| download | chords-77f5e81d0a1adc497040eaa89095635f3de3924e.tar.gz chords-77f5e81d0a1adc497040eaa89095635f3de3924e.zip | |
attach octave values to frets
sometimes just do the simple thing
Diffstat (limited to 'tests.mjs')
| -rw-r--r-- | tests.mjs | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -5,12 +5,16 @@ customElements.define('x-string', class extends HTMLElement { constructor() { super(); console.debug('x-string#constructor', this); - const template = this.querySelector('template').content; - const shadowRoot = this.attachShadow({mode: 'open'}).appendChild(template.cloneNode(true)); - console.debug('attached', template, 'to shadow root', shadowRoot); this.muted.onclick = this.muteClicked.bind(this); this.tonic.onclick = this.fretClicked.bind(this); + this.attachShadow({mode: 'open'}); + } + + connectedCallback() { + const template = this.querySelector('template').content; + this.shadowRoot.appendChild(template.cloneNode(true)); + console.debug('attached', template, 'to shadow root', shadowRoot); } get tonic() { |
