From a3679d4f99f7579e3cb1b0c57f876e3c3512bdf9 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Sat, 2 Feb 2019 12:14:12 +0000 Subject: [PATCH] Beauty fix for URLs --- static/js/devices.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/static/js/devices.js b/static/js/devices.js index a2702bc..9c779fc 100644 --- a/static/js/devices.js +++ b/static/js/devices.js @@ -74,6 +74,9 @@ function showdevices() { $("#linkdevices").css("font-weight", "bold"); $("#linkwifi").css("font-weight", "normal"); $("#linkusers").css("font-weight", "normal"); + + window.history.pushState("", "", "/devices/"); + return false; }; function showwifi() { @@ -84,6 +87,9 @@ function showwifi() { $("#linkdevices").css("font-weight", "normal"); $("#linkwifi").css("font-weight", "bold"); $("#linkusers").css("font-weight", "normal"); + + window.history.pushState("", "", "/wifi/"); + return false; }; function showusers() { @@ -94,10 +100,12 @@ function showusers() { $("#linkdevices").css("font-weight", "normal"); $("#linkwifi").css("font-weight", "normal"); $("#linkusers").css("font-weight", "bold"); + + window.history.pushState("", "", "/users/"); + return false; }; var page = document.location.pathname.substring(1, document.location.pathname.lastIndexOf('/')); -console.log(page) if (page == "users") showusers(); else if (page == "wifi") showwifi(); else showdevices();