diff --git a/res/static/song.js b/res/static/song.js index fc2efd7..50fd498 100644 --- a/res/static/song.js +++ b/res/static/song.js @@ -18,7 +18,6 @@ function size(steps) { TRANSPOSE CHORDS =========================================== */ - ENG_INDEX = {'C': 0, 'C#': 1, 'Db': 1, 'D': 2, 'D#': 3, 'Eb': 3, 'E': 4, 'Fb': 4, 'F': 5, 'E#': 5, 'F#': 6, 'Gb': 6, 'G': 7, 'G#': 8, 'Ab': 8, 'A': 9, 'A#': 10, 'Bb': 10, 'B': 11, 'Cb': 11, 'B#': 0} LAT_INDEX = {'Do': 0, 'Do#': 1, 'Reb': 1, 'Re': 2, 'Re#': 3, 'Mib': 3, 'Mi': 4, 'Fab': 4, 'Fa': 5, 'Mi#': 5, 'Fa#': 6, 'Solb': 6, 'Sol': 7, 'Sol#': 8, 'Lab': 8, 'La': 9, 'La#': 10, 'Sib': 10, 'Si': 11, 'Dob': 11, 'Si#': 0} CHORDS_LAT = ['Do', 'Do#', 'Re', 'Re#', 'Mi', 'Fa', 'Fa#', 'Sol', 'Sol#', 'La', 'Sib', 'Si'] @@ -69,19 +68,21 @@ function getTranspose() { =========================================== */ // Init -document.addEventListener("DOMContentLoaded", function () { +window.onload = function () { var show = localStorage.getItem("show_chords") == "true"; showChords(show); document.getElementById("showChords").checked = show; -}, false); +}; function showChords(show) { if (show || show == "true") { document.getElementById("songLyrics").style.display = "none"; document.getElementById("songChords").style.display = "block"; + document.getElementById("transposeControls").style.display = "block"; } else { document.getElementById("songLyrics").style.display = "block"; document.getElementById("songChords").style.display = "none"; + document.getElementById("transposeControls").style.display = "none"; } localStorage.setItem("show_chords", show); -} \ No newline at end of file +} diff --git a/res/templates/song.html b/res/templates/song.html index fb84f73..97f8d3c 100644 --- a/res/templates/song.html +++ b/res/templates/song.html @@ -28,7 +28,7 @@