mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Allow ids for content tabs with special characters
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -216,7 +216,7 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ 'assets/javascripts/bundle.0238f547.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/bundle.382fbf4b.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 %}
|
||||||
|
|||||||
@@ -84,11 +84,11 @@ export function watchContentTabs(
|
|||||||
const initial = inputs.find(input => input.checked) || inputs[0]
|
const initial = inputs.find(input => input.checked) || inputs[0]
|
||||||
return merge(...inputs.map(input => fromEvent(input, "change")
|
return merge(...inputs.map(input => fromEvent(input, "change")
|
||||||
.pipe(
|
.pipe(
|
||||||
map(() => getElement<HTMLLabelElement>(`label[for=${input.id}]`))
|
map(() => getElement<HTMLLabelElement>(`label[for="${input.id}"]`))
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
.pipe(
|
.pipe(
|
||||||
startWith(getElement<HTMLLabelElement>(`label[for=${initial.id}]`)),
|
startWith(getElement<HTMLLabelElement>(`label[for="${initial.id}"]`)),
|
||||||
map(active => ({ active }))
|
map(active => ({ active }))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -196,7 +196,7 @@ export function mountContentTabs(
|
|||||||
for (const input of getElements<HTMLInputElement>(
|
for (const input of getElements<HTMLInputElement>(
|
||||||
":scope > input", set
|
":scope > input", set
|
||||||
)) {
|
)) {
|
||||||
const label = getElement(`label[for=${input.id}]`)
|
const label = getElement(`label[for="${input.id}"]`)
|
||||||
if (label.innerText.trim() === tab) {
|
if (label.innerText.trim() === tab) {
|
||||||
input.click()
|
input.click()
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user