From 278d42dbc9dcc361298850843283c0474c312479 Mon Sep 17 00:00:00 2001 From: Jonny Tischbein Date: Wed, 21 Nov 2018 19:15:59 +0100 Subject: [PATCH] Save last collapsed panel + restore to open and scroll to top of panel --- view/theme/frio/templates/admin/site.tpl | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); + } + }); -- 2.39.5