Edit history

This commit is contained in:
asyncnomi 2022-12-21 23:22:56 +01:00
parent 770319ed53
commit 4d28d4fec1

View file

@ -2,17 +2,23 @@ const base_url = "https://oss110metz.rezo-rm.fr/"
var historyHandler = [];
window.onpopstate = history.onpushstate = function(e) {
show_page(e.state);
if (e.state) {
show_page(e.state, true);
} else {
history.back();
}
};
history.pushState("#main-page", "", "")
function show_page(id) {
function show_page(id, historyPush) {
$('#main-page').hide();
$('#admin-page').hide();
$('#login-page').hide();
$('#demande-page').hide();
$(id).show();
history.pushState(id, "", "")
if (!historyPush) {
history.pushState(id, "", "")
}
}
$("#login-button").click(function (e) {