2020-02-27 02:34:49 +01:00
|
|
|
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", "");
|
|
|
|
}
|
2020-02-27 14:18:57 +01:00
|
|
|
select.prepend(option);
|
2020-02-27 02:34:49 +01:00
|
|
|
}
|
|
|
|
select.addEventListener("change", function() {
|
|
|
|
if (select.value !== documentBranch) {
|
2020-02-27 14:55:03 +01:00
|
|
|
location.assign(select.value + ".html");
|
2020-02-27 02:34:49 +01:00
|
|
|
select.value = documentBranch;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|