mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-12-01 02:27:17 +01:00
Fixed expanded sections not opening on first click (mobile)
This commit is contained in:
parent
0e359b9649
commit
5d0cae7ca6
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
7
material/assets/javascripts/bundle.b881577d.min.js.map
Normal file
7
material/assets/javascripts/bundle.b881577d.min.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -217,7 +217,7 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ 'assets/javascripts/bundle.9b151c6a.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/bundle.b881577d.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 %}
|
||||||
|
@ -144,7 +144,7 @@ keyboard$
|
|||||||
})
|
})
|
||||||
|
|
||||||
/* Set up patches */
|
/* Set up patches */
|
||||||
patchIndeterminate({ document$ })
|
patchIndeterminate({ document$, tablet$ })
|
||||||
patchScrollfix({ document$ })
|
patchScrollfix({ document$ })
|
||||||
patchScrolllock({ viewport$, tablet$ })
|
patchScrolllock({ viewport$, tablet$ })
|
||||||
|
|
||||||
|
@ -26,7 +26,8 @@ import {
|
|||||||
mergeMap,
|
mergeMap,
|
||||||
switchMap,
|
switchMap,
|
||||||
takeWhile,
|
takeWhile,
|
||||||
tap
|
tap,
|
||||||
|
withLatestFrom
|
||||||
} from "rxjs/operators"
|
} from "rxjs/operators"
|
||||||
|
|
||||||
import { getElements } from "~/browser"
|
import { getElements } from "~/browser"
|
||||||
@ -40,6 +41,7 @@ import { getElements } from "~/browser"
|
|||||||
*/
|
*/
|
||||||
interface PatchOptions {
|
interface PatchOptions {
|
||||||
document$: Observable<Document> /* Document observable */
|
document$: Observable<Document> /* Document observable */
|
||||||
|
tablet$: Observable<boolean> /* Tablet breakpoint observable */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------
|
||||||
@ -55,7 +57,7 @@ interface PatchOptions {
|
|||||||
* @param options - Options
|
* @param options - Options
|
||||||
*/
|
*/
|
||||||
export function patchIndeterminate(
|
export function patchIndeterminate(
|
||||||
{ document$ }: PatchOptions
|
{ document$, tablet$ }: PatchOptions
|
||||||
): void {
|
): void {
|
||||||
document$
|
document$
|
||||||
.pipe(
|
.pipe(
|
||||||
@ -71,10 +73,12 @@ export function patchIndeterminate(
|
|||||||
takeWhile(() => el.hasAttribute("data-md-state")),
|
takeWhile(() => el.hasAttribute("data-md-state")),
|
||||||
mapTo(el)
|
mapTo(el)
|
||||||
)
|
)
|
||||||
|
),
|
||||||
|
withLatestFrom(tablet$)
|
||||||
)
|
)
|
||||||
)
|
.subscribe(([el, tablet]) => {
|
||||||
.subscribe(el => {
|
|
||||||
el.removeAttribute("data-md-state")
|
el.removeAttribute("data-md-state")
|
||||||
|
if (tablet)
|
||||||
el.checked = false
|
el.checked = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user