mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-12 01:50:52 +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>
|
||||
{% endblock %}
|
||||
{% 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 %}
|
||||
{{ script | script_tag }}
|
||||
{% endfor %}
|
||||
|
@ -28,6 +28,8 @@ import {
|
||||
finalize,
|
||||
fromEvent,
|
||||
map,
|
||||
mergeWith,
|
||||
of,
|
||||
tap
|
||||
} from "rxjs"
|
||||
|
||||
@ -82,6 +84,13 @@ export function mountAnnounce(
|
||||
if (!feature("announce.dismiss") || !el.childElementCount)
|
||||
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 */
|
||||
return defer(() => {
|
||||
const push$ = new Subject<Announce>()
|
||||
|
Loading…
Reference in New Issue
Block a user