add o_deepest_active_toc_entry class on deepest active <li> 2
This commit is contained in:
parent
bd4a433124
commit
352477bbac
@ -33,11 +33,13 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (deepestTocEntry) {
|
if (deepestTocEntry) {
|
||||||
deepestTocEntry.classList.add('o_deepest_active_toc_entry');
|
|
||||||
const childTocEntryList = deepestTocEntry.querySelector('ul');
|
const childTocEntryList = deepestTocEntry.querySelector('ul');
|
||||||
if (childTocEntryList) {
|
if (childTocEntryList) {
|
||||||
childTocEntryList.classList.add('show');
|
childTocEntryList.classList.add('show');
|
||||||
|
} else { // If the toc entry is not a TOC, add the class to its closest ancestor entry
|
||||||
|
deepestTocEntry = deepestTocEntry.parentElement.parentElement;
|
||||||
}
|
}
|
||||||
|
deepestTocEntry.classList.add('o_deepest_active_toc_entry');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user