fixed history system

This commit is contained in:
asyncnomi 2022-12-21 23:25:34 +01:00
parent 12e1af1339
commit fb9b4757e1

View file

@ -1,7 +1,6 @@
const base_url = "https://oss110metz.rezo-rm.fr/"
var page = ['#main-page', '#admin-page', '#login-page', '#demande-page'];
var historyHandler = [];
window.onpopstate = history.onpushstate = function(e) {
if (e.state) {
show_page(e.state, true);
@ -11,7 +10,7 @@ window.onpopstate = history.onpushstate = function(e) {
};
history.pushState("#main-page", "", "")
function show_page(id) {
function show_page(id, historyPush) {
for(i in page) {
$(page[i]).hide();
}