1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-07-24 02:01:30 +02:00

Use localstorage

This commit is contained in:
Barry vd. Heuvel
2024-03-19 21:50:30 +01:00
parent bbff3da233
commit 19fb0ce8aa

View File

@@ -1068,8 +1068,8 @@ if (typeof(PhpDebugBar) == 'undefined') {
var AjaxHandler = PhpDebugBar.AjaxHandler = function(debugbar, headerName, autoShow) {
this.debugbar = debugbar;
this.headerName = headerName || 'phpdebugbar';
if (sessionStorage.getItem('phpdebugbar-ajaxhandler-autoshow') !== null) {
this.autoShow = JSON.parse(sessionStorage.getItem('phpdebugbar-ajaxhandler-autoshow'));
if (localStorage.getItem('phpdebugbar-ajaxhandler-autoshow') !== null) {
this.autoShow = localStorage.getItem('phpdebugbar-ajaxhandler-autoshow') == '1';
} else {
this.autoShow = typeof(autoShow) == 'undefined' ? true : autoShow;
}
@@ -1115,7 +1115,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
setAutoShow: function(autoshow) {
this.autoShow = autoshow;
sessionStorage.setItem('phpdebugbar-ajaxhandler-autoshow', JSON.stringify(autoshow));
localStorage.setItem('phpdebugbar-ajaxhandler-autoshow', autoshow ? '1' : '0');
},
/**