mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed sidebar auto-positioning (9.4.2 regression)
This commit is contained in:
parent
53749f2acc
commit
5824c6ca4e
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -249,7 +249,7 @@
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/bundle.94c44541.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/bundle.640d63c8.min.js' | url }}"></script>
|
||||
{% for script in config.extra_javascript %}
|
||||
{{ script | script_tag }}
|
||||
{% endfor %}
|
||||
|
@ -188,7 +188,9 @@ export function mountSidebar(
|
||||
next$.pipe(first())
|
||||
.subscribe(() => {
|
||||
for (const item of getElements(".md-nav__link--active[href]", el)) {
|
||||
const container = getElementContainer(item)
|
||||
if (!item.clientHeight) // skip invisible toc in left sidebar
|
||||
continue
|
||||
const container = item.closest<HTMLElement>(".md-sidebar__scrollwrap")!
|
||||
if (typeof container !== "undefined") {
|
||||
const offset = item.offsetTop - container.offsetTop
|
||||
const { height } = getElementSize(container)
|
||||
|
Loading…
Reference in New Issue
Block a user