Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Feb 29, 2024
1 parent de46c41 commit c7bde2d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
</script>
{% endblock %}
{% 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 %}
{{ script | script_tag }}
{% endfor %}
Expand Down
23 changes: 11 additions & 12 deletions src/templates/assets/javascripts/integrations/instant/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -327,8 +327,8 @@ export function setupInstantNavigation(
// 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
// reason, we fall back and use regular navigation, forcing a reload.
const document$ = location$
.pipe(
const document$ =
location$.pipe(
distinctUntilKeyChanged("pathname"),
switchMap(url => requestHTML(url, { progress$ })
.pipe(
Expand Down Expand Up @@ -421,15 +421,14 @@ export function setupInstantNavigation(
// 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
// history, which means it is too late.
viewport$
.pipe(
distinctUntilKeyChanged("offset"),
debounceTime(100)
)
.subscribe(({ offset }) => {
history.replaceState(offset, "")
})
viewport$.pipe(
distinctUntilKeyChanged("offset"),
debounceTime(100)
)
.subscribe(({ offset }) => {
history.replaceState(offset, "")
})

// Return document
// Return document observable
return document$
}

0 comments on commit c7bde2d

Please sign in to comment.