mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-28 01:10:58 +01:00
Support TOC anchor targets vertical order differing from TOC order.
This commit is contained in:
parent
c0c3a8fbf5
commit
0a6869dcb6
@ -161,6 +161,13 @@ export function watchTableOfContents(
|
||||
}, new Map<HTMLAnchorElement[], number>())
|
||||
}),
|
||||
|
||||
/* Sort index by vertical offset */
|
||||
map(index => (
|
||||
new Map<HTMLAnchorElement[], number>(
|
||||
[...index].sort(([, offsetA], [, offsetB]) => offsetA - offsetB)
|
||||
)
|
||||
)),
|
||||
|
||||
/* Re-compute partition when viewport offset changes */
|
||||
switchMap(index => combineLatest([adjust$, viewport$])
|
||||
.pipe(
|
||||
|
Loading…
Reference in New Issue
Block a user