mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-02 23:42:44 +00:00
Update nav item selector
This commit is contained in:
@@ -10,7 +10,14 @@ const HeaderNav = React.forwardRef(({}, pagesRef)=>{
|
|||||||
|
|
||||||
const renderHeaderLinks = ()=>{
|
const renderHeaderLinks = ()=>{
|
||||||
if(!pagesRef.current) return;
|
if(!pagesRef.current) return;
|
||||||
const elements = pagesRef.current.querySelectorAll('div:not(.toc) > [id]');
|
|
||||||
|
const selector = [
|
||||||
|
'.pages > .page', // All page elements, which by definition have IDs
|
||||||
|
'.page:not(:has(.toc)) > [id]', // All direct children of non-ToC .page with an ID (Legacy)
|
||||||
|
'.page:not(:has(.toc)) > .columnWrapper > [id]', // All direct children of non-ToC .page > .columnWrapper with an ID (V3)
|
||||||
|
'.page:not(:has(.toc)) h2', // All non-ToC H2 titles, like Monster frame titles
|
||||||
|
];
|
||||||
|
const elements = pagesRef.current.querySelectorAll(selector.join(','));
|
||||||
if(!elements) return;
|
if(!elements) return;
|
||||||
const navList = [];
|
const navList = [];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user