From: Jonny Tischbein Date: Wed, 21 Nov 2018 18:15:59 +0000 (+0100) Subject: Save last collapsed panel + restore to open and scroll to top of panel X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=278d42dbc9dcc361298850843283c0474c312479;p=friendica.git Save last collapsed panel + restore to open and scroll to top of panel --- diff --git a/view/theme/frio/templates/admin/site.tpl b/view/theme/frio/templates/admin/site.tpl index 1205277fe4..e638a14c95 100644 --- a/view/theme/frio/templates/admin/site.tpl +++ b/view/theme/frio/templates/admin/site.tpl @@ -38,6 +38,16 @@ 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); + } + });