1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-28 01:10:58 +01:00

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>
{% 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 %}

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
*
@ -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(
@ -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$
}