feat: auto collapsed menu by heading amount
This commit is contained in:
parent
663b1e567f
commit
33e006dbca
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue