mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-28 09:20:52 +01:00
Simplified content tabs implementation
This commit is contained in:
parent
bac1301710
commit
f14d73931f
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -213,7 +213,7 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ 'assets/javascripts/bundle.195ba817.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/bundle.01d7f443.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 %}
|
||||||
|
@ -68,15 +68,12 @@ export function watchContentTabs(
|
|||||||
return merge(...getElements(":scope > input", el)
|
return merge(...getElements(":scope > input", el)
|
||||||
.map(input => fromEvent(input, "change")
|
.map(input => fromEvent(input, "change")
|
||||||
.pipe(
|
.pipe(
|
||||||
mapTo(input.id)
|
mapTo<ContentTabs>({
|
||||||
|
active: getElement(`label[for=${input.id}]`)
|
||||||
|
})
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.pipe(
|
|
||||||
map(id => ({
|
|
||||||
active: getElement<HTMLLabelElement>(`label[for=${id}]`)
|
|
||||||
}))
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -85,7 +85,7 @@ interface MountOptions {
|
|||||||
* @returns Header title observable
|
* @returns Header title observable
|
||||||
*/
|
*/
|
||||||
export function watchHeaderTitle(
|
export function watchHeaderTitle(
|
||||||
el: HTMLHeadingElement, { viewport$, header$ }: WatchOptions
|
el: HTMLElement, { viewport$, header$ }: WatchOptions
|
||||||
): Observable<HeaderTitle> {
|
): Observable<HeaderTitle> {
|
||||||
return watchViewportAt(el, { viewport$, header$ })
|
return watchViewportAt(el, { viewport$, header$ })
|
||||||
.pipe(
|
.pipe(
|
||||||
@ -123,7 +123,7 @@ export function mountHeaderTitle(
|
|||||||
})
|
})
|
||||||
|
|
||||||
/* Obtain headline, if any */
|
/* Obtain headline, if any */
|
||||||
const heading = getOptionalElement<HTMLHeadingElement>("article h1")
|
const heading = getOptionalElement("article h1")
|
||||||
if (typeof heading === "undefined")
|
if (typeof heading === "undefined")
|
||||||
return EMPTY
|
return EMPTY
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user