From 7c600b03803bfddd2d98084ef5c1976e35b84f9e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 26 Jan 2018 11:44:24 +0100 Subject: preserve open state of notifications --- view/js/main.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'view') diff --git a/view/js/main.js b/view/js/main.js index 8eb02156b..13d002968 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -70,11 +70,21 @@ $(document).ready(function() { if(! $('#nav-' + notifyType + '-sub').hasClass('show')) { loadNotificationItems(notifyType); + sessionStorage.setItem('notification_open', notifyType); + } + else { + sessionStorage.removeItem('notification_open'); } $(this).data('clicked', true); }); + if(sessionStorage.getItem('notification_open') !== null) { + var notifyType = sessionStorage.getItem('notification_open'); + $('#nav-' + notifyType + '-sub').addClass('show'); + loadNotificationItems(notifyType); + } + // Allow folks to stop the ajax page updates with the pause/break key $(document).keydown(function(event) { if(event.keyCode == '8') { -- cgit v1.2.3