From 3011db22291df67557c691db1d6585d22c6f04e2 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 7 Feb 2018 12:02:08 +0100 Subject: [PATCH] When reloading, current pane is kept --- client/assets/css/main.css | 4 ---- client/assets/js/main.js | 11 ++++++++++- client/index.html | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/client/assets/css/main.css b/client/assets/css/main.css index 9f96b4b..94d70d6 100644 --- a/client/assets/css/main.css +++ b/client/assets/css/main.css @@ -23,10 +23,6 @@ display: none; } -#pane-keyboard { - display: block; -} - #pointer { height: 80vh; width: 95%; diff --git a/client/assets/js/main.js b/client/assets/js/main.js index a88a6f0..7394c4e 100644 --- a/client/assets/js/main.js +++ b/client/assets/js/main.js @@ -9,10 +9,19 @@ $(function() { var scrollLastTimestamp = null; var scrollLastValue = null; + var hash = window.location.hash; + + if (hash) { + $(hash).show(); + $('a[href="' + hash + '"]').addClass('active'); + } else { + $('#panel-keyboard').show(); + $('#nav a').first().addClass('active'); + } + $('.select2').select2(); $('#nav a').click(function(e) { - e.preventDefault(); $('.pane').hide(); var target = $(this).attr('href'); diff --git a/client/index.html b/client/index.html index 59635c0..dda6be5 100644 --- a/client/index.html +++ b/client/index.html @@ -15,7 +15,7 @@
- You are not connected. Refresh + You are not connected. Refresh