mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-13 18:40:54 +01:00
Fixed announcement bar dismissal when using instant loading
This commit is contained in:
parent
6e1c658a9d
commit
76a30ecab2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -250,7 +250,7 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ 'assets/javascripts/bundle.78eede0e.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/bundle.fa3e4f16.min.js' | url }}"></script>
|
||||||
{% for script in config.extra_javascript %}
|
{% for script in config.extra_javascript %}
|
||||||
{{ script | script_tag }}
|
{{ script | script_tag }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -28,6 +28,8 @@ import {
|
|||||||
finalize,
|
finalize,
|
||||||
fromEvent,
|
fromEvent,
|
||||||
map,
|
map,
|
||||||
|
mergeWith,
|
||||||
|
of,
|
||||||
tap
|
tap
|
||||||
} from "rxjs"
|
} from "rxjs"
|
||||||
|
|
||||||
@ -82,6 +84,13 @@ export function mountAnnounce(
|
|||||||
if (!feature("announce.dismiss") || !el.childElementCount)
|
if (!feature("announce.dismiss") || !el.childElementCount)
|
||||||
return EMPTY
|
return EMPTY
|
||||||
|
|
||||||
|
/* Support instant loading - see https://t.ly/3FTme */
|
||||||
|
if (!el.hidden) {
|
||||||
|
const content = getElement(".md-typeset", el)
|
||||||
|
if (__md_hash(content.innerHTML) === __md_get("__announce"))
|
||||||
|
el.hidden = true
|
||||||
|
}
|
||||||
|
|
||||||
/* Mount component on subscription */
|
/* Mount component on subscription */
|
||||||
return defer(() => {
|
return defer(() => {
|
||||||
const push$ = new Subject<Announce>()
|
const push$ = new Subject<Announce>()
|
||||||
|
Loading…
Reference in New Issue
Block a user