mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
20 lines
693 B
JavaScript
20 lines
693 B
JavaScript
window.addEventListener("load", function() {
|
|
let select = document.querySelector("header .documentBranch select");
|
|
while (select.firstChild) {
|
|
select.removeChild(select.firstChild);
|
|
}
|
|
for (let branch of documentBranches) {
|
|
let option = document.createElement("option");
|
|
option.textContent = branch;
|
|
if (branch === documentBranch) {
|
|
option.setAttribute("selected", "");
|
|
}
|
|
select.prepend(option);
|
|
}
|
|
select.addEventListener("change", function() {
|
|
if (select.value !== documentBranch) {
|
|
location.assign(select.value + ".html");
|
|
select.value = documentBranch;
|
|
}
|
|
});
|
|
});
|