Fixed home button not working occasionally when using versioning

This commit is contained in:
squidfunk 2022-07-03 10:27:53 +02:00
parent adabdd0bec
commit a261130204
4 changed files with 6 additions and 6 deletions

View File

@ -216,7 +216,7 @@
</script> </script>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
<script src="{{ 'assets/javascripts/bundle.382fbf4b.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/bundle.6c7ad80a.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

@ -105,7 +105,6 @@ export function setupVersionSelector(
if (ev.target instanceof Element) { if (ev.target instanceof Element) {
const el = ev.target.closest("a") const el = ev.target.closest("a")
if (el && !el.target && urls.has(el.href)) { if (el && !el.target && urls.has(el.href)) {
ev.preventDefault()
const url = el.href const url = el.href
// This is a temporary hack to detect if a version inside the // This is a temporary hack to detect if a version inside the
// version selector or on another part of the site was clicked. // version selector or on another part of the site was clicked.
@ -122,6 +121,7 @@ export function setupVersionSelector(
if (version === current) if (version === current)
return EMPTY return EMPTY
} }
ev.preventDefault()
return of(url) return of(url)
} }
} }