Edit history
This commit is contained in:
parent
770319ed53
commit
4d28d4fec1
1 changed files with 9 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue