diff --git a/js/index.js b/js/index.js index 4bff516..ce0195c 100644 --- a/js/index.js +++ b/js/index.js @@ -318,23 +318,22 @@ var onHide = function() { if (this.id && BR.Util.localStorageAvailable()) { - localStorage[this.id] = 'true'; + localStorage.removeItem(this.id); } }; var onShow = function() { if (this.id && BR.Util.localStorageAvailable()) { - localStorage.removeItem(this.id); + localStorage[this.id] = 'true'; } }; // on page load, we want to restore collapsible elements from previous usage $('.collapse').on('hidden.bs.collapse', onHide) .on('shown.bs.collapse', onShow) .each(function() { - if (!(this.id && BR.Util.localStorageAvailable() && localStorage[this.id] === 'true' )) { - $(this).collapse('hide'); + if (this.id && BR.Util.localStorageAvailable() && localStorage[this.id] === 'true') { + $(this).collapse('show'); } }); - } mapContext = BR.Map.initMap();