mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
21 lines
696 B
JavaScript
21 lines
696 B
JavaScript
|
window.addEventListener("load", function() {
|
||
|
let select = document.querySelector("header select.documentBranch");
|
||
|
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.appendChild(option);
|
||
|
}
|
||
|
select.addEventListener("change", function() {
|
||
|
if (select.value !== documentBranch) {
|
||
|
location.assign(select.value + ".html");
|
||
|
select.value = documentBranch;
|
||
|
}
|
||
|
});
|
||
|
});
|