mirror of
https://gitlab.com/parroquia-san-leandro/cancionero-web.git
synced 2026-01-28 13:07:58 +01:00
show external link for hash-loaded songs
This commit is contained in:
parent
a0ef0bcead
commit
50a250888d
1 changed files with 4 additions and 1 deletions
|
|
@ -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;
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue