Skip to content

Commit 3cc7c73

Browse files
committed
feat: automatically scroll the sidebar menu to the active item
1 parent 41992cd commit 3cc7c73

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

js/common.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,11 @@ $(document).ready(function () {
688688
flashMessage($(this));
689689
});
690690
/* }}} */
691+
692+
const activeItem = document.querySelector(".layout-menu .current");
693+
if (activeItem) {
694+
activeItem.scrollIntoView({ block: "center" });
695+
}
691696
});
692697

693698
/* {{{ add-user.php animations */

0 commit comments

Comments
 (0)