summaryrefslogtreecommitdiffstats
path: root/string.mjs
diff options
context:
space:
mode:
authorBrian Cully <bjc@spork.org>2025-07-28 11:37:07 -0400
committerBrian Cully <bjc@spork.org>2025-07-28 11:37:07 -0400
commit98de6f70b8d50b695b343bdbaf14c9023ba27286 (patch)
tree4aaf3fb8876e7ad96dbe02999a4c6ac15ebe60c2 /string.mjs
parent82e797c8b303393aa7d0b16787ec353b520dec44 (diff)
downloadchords-98de6f70b8d50b695b343bdbaf14c9023ba27286.tar.gz
chords-98de6f70b8d50b695b343bdbaf14c9023ba27286.zip
fix string selection update on click
Diffstat (limited to 'string.mjs')
-rw-r--r--string.mjs7
1 files changed, 7 insertions, 0 deletions
diff --git a/string.mjs b/string.mjs
index cf9b759..39a3533 100644
--- a/string.mjs
+++ b/string.mjs
@@ -53,6 +53,12 @@ export default class extends HTMLElement {
})
}
+ updateSelected() {
+ this.querySelectorAll('.selected').forEach(s => {
+ s.innerText = this.getAttribute('value');
+ });
+ }
+
muteClicked(e) {
console.debug('String#muteClicked', this, e);
if (this.getAttribute('value') !== 'x') {
@@ -69,6 +75,7 @@ export default class extends HTMLElement {
console.debug(' -- note', e.target.note);
this.setAttribute('value', e.target.getAttribute('value'));
this.setAttribute('octave', e.target.getAttribute('octave'));
+ this.updateSelected();
}
render() {