Browse Source

Fixes

pull/3/head
M@dD3n 5 years ago
parent
commit
9ceed4e4fa
  1. 21
      lib/debug/debug.js

21
lib/debug/debug.js

@ -14,7 +14,7 @@ var Debug = {
}, },
build: function () { build: function () {
this.debugCookie(); //
}, },
events: function () { events: function () {
@ -27,9 +27,9 @@ var Debug = {
event.preventDefault(); event.preventDefault();
$bar = $('#debug_bar'); let $bar = $('#debug_bar');
if ($bar.css('display') == 'none') { if ($bar.css('display') === 'none') {
$(document.body).css('overflow', 'hidden'); $(document.body).css('overflow', 'hidden');
$bar.show(); $bar.show();
} else { } else {
@ -37,6 +37,7 @@ var Debug = {
$bar.hide(); $bar.hide();
} }
Debug.debugStorage();
}); });
}, },
@ -53,17 +54,17 @@ var Debug = {
$('#' + this.id + '-cont').show(); $('#' + this.id + '-cont').show();
if ($.cookie) { localStorage.setItem('__debug_bar', this.id);
$.cookie('__debug_bar', this.id, {expires: 7, path: '/'});
}
}); });
}, },
debugCookie: function () { debugStorage: function () {
if ($.cookie) {
var id = $.cookie('__debug_bar'); let localValue = localStorage.getItem('__debug_bar');
if (localValue !== '') {
var tab = $('.debug_tabs > li#' + id); let tab = $('.debug_tabs > li#' + localValue);
if (tab.length > 0) { if (tab.length > 0) {
tab.click(); tab.click();

Loading…
Cancel
Save