2020-02-27 02:34:49 +01:00
|
|
|
window.addEventListener("load", function() {
|
2021-12-05 13:26:36 +01:00
|
|
|
function resetSelect(select) {
|
|
|
|
for (let option of select.options) {
|
|
|
|
option.selected = option.defaultSelected;
|
|
|
|
}
|
2020-02-27 02:34:49 +01:00
|
|
|
}
|
2021-12-05 13:26:36 +01:00
|
|
|
let select = document.querySelector("header .documentBranch select");
|
|
|
|
resetSelect(select);
|
2020-02-27 02:34:49 +01:00
|
|
|
select.addEventListener("change", function() {
|
2021-12-05 13:26:36 +01:00
|
|
|
let option = select.selectedOptions.item(0);
|
|
|
|
if (option && !option.defaultSelected) {
|
|
|
|
location.assign(option.value);
|
2020-02-27 02:34:49 +01:00
|
|
|
}
|
2021-12-05 13:26:36 +01:00
|
|
|
resetSelect(select);
|
2020-02-27 02:34:49 +01:00
|
|
|
});
|
|
|
|
});
|