Formatting

This commit is contained in:
squidfunk 2024-02-29 08:37:23 +07:00
parent de46c4153b
commit c7bde2d3ff
No known key found for this signature in database
GPG Key ID: 5ED40BC4F9C436DF
4 changed files with 15 additions and 16 deletions

View File

@ -249,7 +249,7 @@
</script> </script>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
<script src="{{ 'assets/javascripts/bundle.cee5e008.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/bundle.553b3b51.min.js' | url }}"></script>
{% for script in config.extra_javascript %} {% for script in config.extra_javascript %}
{{ script | script_tag }} {{ script | script_tag }}
{% endfor %} {% endfor %}

View File

@ -168,7 +168,7 @@ function resolve(document: Document): Observable<Document> {
} }
/** /**
* Create a map of head elements for lookup and replacement * Inject the contents of a document into the current one
* *
* @param next - Next document * @param next - Next document
* *
@ -327,8 +327,8 @@ export function setupInstantNavigation(
// that are not needed anymore, e.g., when the user clicks multiple links in // that are not needed anymore, e.g., when the user clicks multiple links in
// quick succession or on slow connections. If the request fails for some // quick succession or on slow connections. If the request fails for some
// reason, we fall back and use regular navigation, forcing a reload. // reason, we fall back and use regular navigation, forcing a reload.
const document$ = location$ const document$ =
.pipe( location$.pipe(
distinctUntilKeyChanged("pathname"), distinctUntilKeyChanged("pathname"),
switchMap(url => requestHTML(url, { progress$ }) switchMap(url => requestHTML(url, { progress$ })
.pipe( .pipe(
@ -421,15 +421,14 @@ export function setupInstantNavigation(
// and forth between pages. Note that this must be debounced and cannot be // and forth between pages. Note that this must be debounced and cannot be
// done in popstate, as popstate has already removed the entry from the // done in popstate, as popstate has already removed the entry from the
// history, which means it is too late. // history, which means it is too late.
viewport$ viewport$.pipe(
.pipe( distinctUntilKeyChanged("offset"),
distinctUntilKeyChanged("offset"), debounceTime(100)
debounceTime(100) )
) .subscribe(({ offset }) => {
.subscribe(({ offset }) => { history.replaceState(offset, "")
history.replaceState(offset, "") })
})
// Return document // Return document observable
return document$ return document$
} }