Merge branch 'panel'

This commit is contained in:
Boris Bobrov 2016-09-16 09:47:54 +03:00
commit 821686372c
2 changed files with 22 additions and 3 deletions

View File

@ -35,6 +35,7 @@ Thank you!
* David Thompson
* Daniel Krol
* Daniel Neel
* Dealsy
* Deb Nicholson
* Devan Goodwin
* Derek Moore

View File

@ -17,9 +17,27 @@
*/
$(document).ready(function(){
// The header drop-down header panel defaults to open until you explicitly
// close it. After that, the panel open/closed setting will persist across
// page loads.
// Initialise the panel status when page is loaded.
if (localStorage.getItem("panel_closed")) {
$("#header_dropdown").hide();
$(".header_dropdown_up").hide();
}
else {
$(".header_dropdown_down").hide();
}
// Toggle and persist the panel status.
$(".header_dropdown_down, .header_dropdown_up").click(function() {
if (localStorage.getItem("panel_closed")) {
localStorage.removeItem("panel_closed");
}
else {
localStorage.setItem("panel_closed", "true");
}
$(".header_dropdown_down").toggle();
$(".header_dropdown_up").toggle();
$("#header_dropdown").slideToggle();