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
material
src/assets/javascripts/components/header/title

View File

@ -240,7 +240,7 @@
</script> </script>
{% endblock %} {% endblock %}
{% block scripts %} {% 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 %} {% for path in config.extra_javascript %}
<script src="{{ path | url }}"></script> <script src="{{ path | url }}"></script>
{% endfor %} {% endfor %}

View File

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