mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed rendering of back-to-top button when used with sticky tabs
This commit is contained in:
parent
7ca4ca1a90
commit
7abeb68708
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -223,7 +223,7 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ 'assets/javascripts/bundle.8400c76f.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/bundle.d7b0ad22.min.js' | url }}"></script>
|
||||||
{% for path in config["extra_javascript"] %}
|
{% for path in config["extra_javascript"] %}
|
||||||
<script src="{{ path | url }}"></script>
|
<script src="{{ path | url }}"></script>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -43,7 +43,7 @@ import {
|
|||||||
setBackToTopOffset,
|
setBackToTopOffset,
|
||||||
setBackToTopState
|
setBackToTopState
|
||||||
} from "~/actions"
|
} from "~/actions"
|
||||||
import { Viewport } from "~/browser"
|
import { Viewport, setElementFocus } from "~/browser"
|
||||||
|
|
||||||
import { Component } from "../_"
|
import { Component } from "../_"
|
||||||
import { Header } from "../header"
|
import { Header } from "../header"
|
||||||
@ -103,7 +103,7 @@ export function watchBackToTop(
|
|||||||
.pipe(
|
.pipe(
|
||||||
map(({ offset: { y } }) => y),
|
map(({ offset: { y } }) => y),
|
||||||
bufferCount(2, 1),
|
bufferCount(2, 1),
|
||||||
map(([a, b]) => a > b),
|
map(([a, b]) => a > b && b),
|
||||||
distinctUntilChanged()
|
distinctUntilChanged()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -153,10 +153,12 @@ export function mountBackToTop(
|
|||||||
/* Update state */
|
/* Update state */
|
||||||
next([{ hidden }, { height }]) {
|
next([{ hidden }, { height }]) {
|
||||||
setBackToTopOffset(el, height + 16)
|
setBackToTopOffset(el, height + 16)
|
||||||
if (hidden)
|
if (hidden) {
|
||||||
setBackToTopState(el, "hidden")
|
setBackToTopState(el, "hidden")
|
||||||
else
|
setElementFocus(el, false)
|
||||||
|
} else {
|
||||||
resetBackToTopState(el)
|
resetBackToTopState(el)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Reset on complete */
|
/* Reset on complete */
|
||||||
|
Loading…
Reference in New Issue
Block a user