diff --git a/src/DebugBar/Resources/debugbar.js b/src/DebugBar/Resources/debugbar.js index 47aa66a..eb64271 100644 --- a/src/DebugBar/Resources/debugbar.js +++ b/src/DebugBar/Resources/debugbar.js @@ -1058,7 +1058,11 @@ if (typeof(PhpDebugBar) == 'undefined') { var AjaxHandler = PhpDebugBar.AjaxHandler = function(debugbar, headerName, autoShow) { this.debugbar = debugbar; this.headerName = headerName || 'phpdebugbar'; - this.autoShow = typeof(autoShow) == 'undefined' ? true : autoShow; + if (sessionStorage.getItem('phpdebugbar-ajaxhandler-autoshow') !== null) { + this.autoShow = JSON.parse(sessionStorage.getItem('phpdebugbar-ajaxhandler-autoshow')); + } else { + this.autoShow = typeof(autoShow) == 'undefined' ? true : autoShow; + } }; $.extend(AjaxHandler.prototype, { @@ -1099,6 +1103,11 @@ if (typeof(PhpDebugBar) == 'undefined') { return Object.prototype.toString.call(response) == '[object XMLHttpRequest]' }, + setAutoShow: function(autoshow) { + this.autoShow = autoshow; + sessionStorage.setItem('phpdebugbar-ajaxhandler-autoshow', JSON.stringify(autoshow)); + }, + /** * Checks if the HEADER-id exists and loads the dataset using the open handler * diff --git a/src/DebugBar/Resources/widgets.js b/src/DebugBar/Resources/widgets.js index bead570..c9eba3e 100644 --- a/src/DebugBar/Resources/widgets.js +++ b/src/DebugBar/Resources/widgets.js @@ -670,7 +670,7 @@ if (typeof(PhpDebugBar) == 'undefined') { this.$autoshow = $('') .on('click', function() { if (window.phpdebugbar.ajaxHandler) { - window.phpdebugbar.ajaxHandler.autoShow = $(this).is(':checked'); + window.phpdebugbar.ajaxHandler.setAutoShow($(this).is(':checked')); } });