mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
16 lines
553 B
JavaScript
16 lines
553 B
JavaScript
window.addEventListener("DOMContentLoaded", function() {
|
|
function resetSelect(select) {
|
|
for (let option of select.options) {
|
|
option.selected = option.defaultSelected;
|
|
}
|
|
}
|
|
let select = document.querySelector("header .documentBranch select");
|
|
resetSelect(select);
|
|
select.addEventListener("change", function() {
|
|
let option = select.selectedOptions.item(0);
|
|
if (option && !option.defaultSelected) {
|
|
location.assign(option.value);
|
|
}
|
|
resetSelect(select);
|
|
});
|
|
});
|