Browse Source

Merge branch 'master' of git.rezo-rm.fr:BDEMetz/bde-liste

master
asyncnomi 3 years ago
parent
commit
12e1af1339
  1. 14
      static/js/main.js

14
static/js/main.js

@ -1,5 +1,6 @@
const base_url = "https://oss110metz.rezo-rm.fr/" const base_url = "https://oss110metz.rezo-rm.fr/"
var page = ['#main-page', '#admin-page', '#login-page', '#demande-page'];
var historyHandler = []; var historyHandler = [];
window.onpopstate = history.onpushstate = function(e) { window.onpopstate = history.onpushstate = function(e) {
if (e.state) { if (e.state) {
@ -10,11 +11,10 @@ window.onpopstate = history.onpushstate = function(e) {
}; };
history.pushState("#main-page", "", "") history.pushState("#main-page", "", "")
function show_page(id, historyPush) { function show_page(id) {
$('#main-page').hide(); for(i in page) {
$('#admin-page').hide(); $(page[i]).hide();
$('#login-page').hide(); }
$('#demande-page').hide();
$(id).show(); $(id).show();
if (!historyPush) { if (!historyPush) {
history.pushState(id, "", "") history.pushState(id, "", "")
@ -64,6 +64,10 @@ $(window).on("load", function() {
navigator.serviceWorker.register('./js/sw.js'); navigator.serviceWorker.register('./js/sw.js');
} }
for(i in page) {
$(page[i]).css('z-index', i);
}
/* load timer */ /* load timer */
window.setInterval(function() { window.setInterval(function() {
var time = $("#timer").text(); var time = $("#timer").text();

Loading…
Cancel
Save