summaryrefslogtreecommitdiffstats
path: root/tests.mjs
diff options
context:
space:
mode:
authorBrian Cully <bjc@spork.org>2025-07-28 08:52:51 -0400
committerBrian Cully <bjc@spork.org>2025-07-28 08:52:51 -0400
commit77f5e81d0a1adc497040eaa89095635f3de3924e (patch)
tree4ad6a00edf5cfe3c5c2bf0090ba80f8d13c143cc /tests.mjs
parent2d12e407ccac850dd2e1ce133a2f335677a2ef29 (diff)
downloadchords-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.mjs10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests.mjs b/tests.mjs
index e7095f8..1dc4c09 100644
--- a/tests.mjs
+++ b/tests.mjs
@@ -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() {