Fixed header title not reset on missing headline when using instant loading

This commit is contained in:
squidfunk 2023-02-09 21:19:13 +01:00
parent 48e8b2be30
commit ff99e19741
4 changed files with 16 additions and 7 deletions

View File

@ -240,7 +240,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.1ef2e63d.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.4b2c34cd.min.js' | url }}"></script>
{% for path in config.extra_javascript %}
<script src="{{ path | url }}"></script>
{% endfor %}

View File

@ -115,8 +115,17 @@ export function mountHeaderTitle(
): Observable<Component<HeaderTitle>> {
return defer(() => {
const push$ = new Subject<HeaderTitle>()
push$.subscribe(({ active }) => {
push$.subscribe({
/* Handle emission */
next({ active }) {
el.classList.toggle("md-header__title--active", active)
},
/* Handle complete */
complete() {
el.classList.remove("md-header__title--active")
}
})
/* Obtain headline, if any */