1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-12-22 17:10:10 +00: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) {
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) {
const req = new XMLHttpRequest();
req.responseType = 'json';