]> git.mxchange.org Git - friendica.git/commitdiff
Save last collapsed panel + restore to open and scroll to top of panel
authorJonny Tischbein <jonny_tischbein@systemli.org>
Wed, 21 Nov 2018 18:15:59 +0000 (19:15 +0100)
committerJonny Tischbein <jonny_tischbein@systemli.org>
Wed, 21 Nov 2018 18:15:59 +0000 (19:15 +0100)
view/theme/frio/templates/admin/site.tpl

index 1205277fe42c5ef3ce30062b9eca37fe62418615..e638a14c953f11a7c7577b306f524249f058e7b3 100644 (file)
                        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>
 <link rel="stylesheet" href="view/theme/frio/css/mod_admin.css" type="text/css" media="screen"/>