14 lines
378 B
JavaScript
14 lines
378 B
JavaScript
(function () {
|
|
const switcher = document.getElementById('kb-version-switcher');
|
|
if (!switcher) {
|
|
return;
|
|
}
|
|
|
|
switcher.addEventListener('change', function () {
|
|
const selected = switcher.options[switcher.selectedIndex];
|
|
if (selected && selected.dataset.url) {
|
|
window.location.href = selected.dataset.url;
|
|
}
|
|
});
|
|
}());
|