1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-06-26 19:37:46 +02:00

add backwards navigation

This commit is contained in:
Harvey Tindall 2021-01-31 17:32:03 +00:00
parent ee026714d4
commit ce98b2eb5a
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2

View File

@ -105,9 +105,14 @@ document.addEventListener("tab-change", (event: CustomEvent) => {
if (lang) { if (lang) {
tab += "?lang=" + lang tab += "?lang=" + lang
} }
window.history.replaceState("", "Admin - jfa-go", tab); window.history.pushState(event.detail, "Admin - jfa-go", tab);
}); });
window.onpopstate = (event: PopStateEvent) => {
console.log(event.state);
window.tabs.switch(event.state);
}
function login(username: string, password: string, run?: (state?: number) => void) { function login(username: string, password: string, run?: (state?: number) => void) {
const req = new XMLHttpRequest(); const req = new XMLHttpRequest();
req.responseType = 'json'; req.responseType = 'json';