From 9ceed4e4faf04ca111ac56b29f593fccd60bdac0 Mon Sep 17 00:00:00 2001 From: "M@dD3n" Date: Thu, 29 Aug 2019 14:10:36 +0300 Subject: [PATCH] Fixes --- lib/debug/debug.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/debug/debug.js b/lib/debug/debug.js index 7be7d3b..ac5be68 100644 --- a/lib/debug/debug.js +++ b/lib/debug/debug.js @@ -14,7 +14,7 @@ var Debug = { }, build: function () { - this.debugCookie(); + // }, events: function () { @@ -27,9 +27,9 @@ var Debug = { event.preventDefault(); - $bar = $('#debug_bar'); + let $bar = $('#debug_bar'); - if ($bar.css('display') == 'none') { + if ($bar.css('display') === 'none') { $(document.body).css('overflow', 'hidden'); $bar.show(); } else { @@ -37,6 +37,7 @@ var Debug = { $bar.hide(); } + Debug.debugStorage(); }); }, @@ -53,17 +54,17 @@ var Debug = { $('#' + this.id + '-cont').show(); - if ($.cookie) { - $.cookie('__debug_bar', this.id, {expires: 7, path: '/'}); - } + localStorage.setItem('__debug_bar', this.id); }); }, - debugCookie: function () { - if ($.cookie) { - var id = $.cookie('__debug_bar'); + debugStorage: function () { + + let localValue = localStorage.getItem('__debug_bar'); + + if (localValue !== '') { - var tab = $('.debug_tabs > li#' + id); + let tab = $('.debug_tabs > li#' + localValue); if (tab.length > 0) { tab.click();