feat: auto collapsed menu by heading amount

This commit is contained in:
jeffreytse 2020-08-31 19:46:13 +08:00
parent 663b1e567f
commit 33e006dbca

View file

@ -36,8 +36,13 @@
// The header element
var header = document.querySelector('header.site-header');
function doMenuCollapse(index) {
function doMenuCollapse(index, over_items=20) {
var items = menuContent.firstChild.children;
if (items.length < over_items) {
return;
}
var activeItem = items[index];
var beginItem = activeItem
var endItem = activeItem