summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fretboard.mjs13
-rw-r--r--string.mjs7
2 files changed, 7 insertions, 13 deletions
diff --git a/fretboard.mjs b/fretboard.mjs
index cae94ec..017d273 100644
--- a/fretboard.mjs
+++ b/fretboard.mjs
@@ -94,19 +94,6 @@ export default class extends HTMLElement {
});
}
- updateSelected(formData) {
- // this.querySelectorAll('tbody .selected').forEach(elt => {
- // const string = Array.from(elt.parentNode.classList).filter(x => x.startsWith('string'))[0];
- // const val = formData.get(string);
- // const note = Note.fromString(fretToNote(this, string, val));
- // if (note.isSharp) {
- // elt.innerText = `${note} / ${note.toAlternateString()}`;
- // } else {
- // elt.innerText = note;
- // }
- // });
- }
-
zotStrings() {
console.debug('Fretboard#zotStrings', this);
const tmpl = this.querySelector('template.string');
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() {