diff --git a/res_gen/templates/generador.html b/res_gen/templates/generador.html index 347ec81..ad8a304 100644 --- a/res_gen/templates/generador.html +++ b/res_gen/templates/generador.html @@ -206,6 +206,7 @@ function addSpecificSong(n) { for (let opt of select.options) { if (opt.textContent.slice(0, opt.textContent.indexOf(".")) == n) { select.value = opt.value; + select.dispatchEvent(new Event("change")); break; } } @@ -306,7 +307,7 @@ function setSong(event) { a.href = "" a.classList = []; } - regenHash(); + if (loadComplete) regenHash(); } function toggleCols(event) { @@ -329,12 +330,14 @@ function toggleColSep(event) { colsep.disabled = !input.checked; } +var loadComplete = false; window.addEventListener("load", function () { if (window.location.hash) { // Load songs for (let n of window.location.hash.slice(1).split(",")) addSpecificSong(n); } + loadComplete = true; });