mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed glitch in sidebar when collapsing items
This commit is contained in:
parent
71fc5d1d37
commit
4ca20f1b8b
6
material/assets/javascripts/application.43ad2ac2.js
Normal file
6
material/assets/javascripts/application.43ad2ac2.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -190,7 +190,7 @@
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/application.efe184c7.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/application.43ad2ac2.js' | url }}"></script>
|
||||
{% if lang.t("search.language") != "en" %}
|
||||
{% set languages = lang.t("search.language").split(",") %}
|
||||
{% if languages | length and languages[0] != "" %}
|
||||
|
@ -70,8 +70,14 @@ export default class Collapse {
|
||||
this.el_.style.display = "block"
|
||||
this.el_.style.overflow = ""
|
||||
|
||||
/* Hack: read value directly from input field */
|
||||
const expanded = this.el_
|
||||
.previousElementSibling
|
||||
.previousElementSibling
|
||||
.checked
|
||||
|
||||
/* Expanded, so collapse */
|
||||
if (current) {
|
||||
if (expanded) {
|
||||
this.el_.style.maxHeight = `${current}px`
|
||||
requestAnimationFrame(() => {
|
||||
this.el_.setAttribute("data-md-state", "animate")
|
||||
@ -107,8 +113,8 @@ export default class Collapse {
|
||||
|
||||
/* Hidden links should not be focusable, so hide them when the navigation
|
||||
is collapsed and set overflow so the outline is not cut off */
|
||||
target.style.display = current ? "none" : "block"
|
||||
target.style.overflow = current ? "hidden" : "visible"
|
||||
target.style.display = expanded ? "none" : "block"
|
||||
target.style.overflow = expanded ? "hidden" : "visible"
|
||||
|
||||
/* Only fire once, so directly remove event listener */
|
||||
target.removeEventListener("transitionend", end)
|
||||
|
Loading…
Reference in New Issue
Block a user