Remember sidebar toggle-state

While browsing a wiki, it would be nice if it would remember whether the
content is wide or not.

SPR-883
This commit is contained in:
Michael Große 2017-04-20 16:23:26 +02:00
commit fdf5eaea74
No known key found for this signature in database
GPG key ID: 7E31028FBFEACC79

View file

@ -12,6 +12,7 @@ jQuery(function () {
$nav.find('div.nav-panel').hide(); // close all panels
jQuery('body').addClass('wide-content');
removeToggleStorage();
sessionStorage.setItem('wide-content', true);
},
/**
@ -32,7 +33,7 @@ jQuery(function () {
*/
setDefaultContent = function () {
jQuery('body').removeClass('wide-content');
sessionStorage.setItem('wide-content', false);
},
/**
@ -166,6 +167,10 @@ jQuery(function () {
setWideContent();
}
});
if (sessionStorage.getItem('wide-content') === 'true') {
setWideContent();
}
},
/**