mirror of
https://github.com/hrfee/jfa-go.git
synced 2025-01-03 15:00:12 +00:00
keep language choice in url when changing tabs
This commit is contained in:
parent
ffc62574ec
commit
e68dccbc17
@ -94,12 +94,17 @@ if (window.location.pathname == "/") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener("tab-change", (event: CustomEvent) => {
|
document.addEventListener("tab-change", (event: CustomEvent) => {
|
||||||
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
|
const lang = urlParams.get('lang');
|
||||||
let tab = "/" + event.detail;
|
let tab = "/" + event.detail;
|
||||||
if (tab == "/invites") {
|
if (tab == "/invites") {
|
||||||
if (window.location.pathname == "/") {
|
if (window.location.pathname == "/") {
|
||||||
tab = "/";
|
tab = "/";
|
||||||
} else { tab = "../"; }
|
} else { tab = "../"; }
|
||||||
}
|
}
|
||||||
|
if (lang) {
|
||||||
|
tab += "?lang=" + lang
|
||||||
|
}
|
||||||
window.history.replaceState("", "Admin - jfa-go", tab);
|
window.history.replaceState("", "Admin - jfa-go", tab);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user