Save last collapsed panel + restore to open and scroll to top of panel

This commit is contained in:
Jonny Tischbein 2018-11-21 19:15:59 +01:00
parent 860b7bad73
commit 278d42dbc9

View file

@ -38,6 +38,16 @@
return false; return false;
}); });
}); });
$(function(){
$(".collapse").on('show.bs.collapse', function(e) {
localStorage.setItem('activeTab', $(e.target).attr('id'));
});
var activeTab = localStorage.getItem('activeTab');
if (activeTab) {
$("#" + activeTab).collapse('show');
window.scroll(0, $("#" + activeTab).offset().top - 120);
}
});
</script> </script>
<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css" type="text/css" media="screen"/> <link rel="stylesheet" href="view/theme/frio/css/mod_admin.css" type="text/css" media="screen"/>