mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00
Fix path changer
This commit is contained in:
parent
de2528e75b
commit
c90495277d
@ -28,8 +28,12 @@ window.addEventListener("load", () => {
|
||||
selectElement.add(option);
|
||||
|
||||
selectElement.addEventListener('change', (event) => {
|
||||
const versionlessPath = window.location.pathname.split('/').slice(2).join('/');
|
||||
window.location = `${window.location.origin}/${event.target.value}/${versionlessPath}`;
|
||||
const path = [
|
||||
...window.location.pathname.split('/').slice(0, 2),
|
||||
event.target.value,
|
||||
...window.location.pathname.split('/').slice(3)].join('/')
|
||||
].join('/');
|
||||
window.location = `${window.location.origin}${path}`;
|
||||
});
|
||||
|
||||
document.querySelector(".version-box").appendChild(selectElement);
|
||||
|
Loading…
x
Reference in New Issue
Block a user