mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed stealing of hash fragments when using navigation tracking
This commit is contained in:
parent
e3c26215de
commit
8deb1c2425
File diff suppressed because one or more lines are too long
8
material/assets/javascripts/bundle.9f3ca3d1.min.js.map
Normal file
8
material/assets/javascripts/bundle.9f3ca3d1.min.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -213,7 +213,7 @@
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/bundle.cd6d3f86.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/bundle.9f3ca3d1.min.js' | url }}"></script>
|
||||
{% for path in config["extra_javascript"] %}
|
||||
<script src="{{ path | url }}"></script>
|
||||
{% endfor %}
|
||||
|
@ -229,7 +229,7 @@ const content$ = defer(() => merge(
|
||||
|
||||
/* Table of contents */
|
||||
...getComponentElements("toc")
|
||||
.map(el => mountTableOfContents(el, { viewport$, header$ })),
|
||||
.map(el => mountTableOfContents(el, { viewport$, header$, target$ })),
|
||||
|
||||
/* Back-to-top button */
|
||||
...getComponentElements("top")
|
||||
|
@ -32,7 +32,9 @@ import {
|
||||
finalize,
|
||||
map,
|
||||
of,
|
||||
repeat,
|
||||
scan,
|
||||
skip,
|
||||
startWith,
|
||||
switchMap,
|
||||
takeLast,
|
||||
@ -83,6 +85,7 @@ interface WatchOptions {
|
||||
interface MountOptions {
|
||||
viewport$: Observable<Viewport> /* Viewport observable */
|
||||
header$: Observable<Header> /* Header observable */
|
||||
target$: Observable<HTMLElement> /* Location target observable */
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
@ -247,7 +250,7 @@ export function watchTableOfContents(
|
||||
* @returns Table of contents component observable
|
||||
*/
|
||||
export function mountTableOfContents(
|
||||
el: HTMLElement, { viewport$, header$ }: MountOptions
|
||||
el: HTMLElement, { viewport$, header$, target$ }: MountOptions
|
||||
): Observable<Component<TableOfContents>> {
|
||||
return defer(() => {
|
||||
const push$ = new Subject<TableOfContents>()
|
||||
@ -278,6 +281,9 @@ export function mountTableOfContents(
|
||||
takeUntil(push$.pipe(takeLast(1))),
|
||||
distinctUntilKeyChanged("offset"),
|
||||
debounceTime(250),
|
||||
skip(1),
|
||||
takeUntil(target$.pipe(skip(1))),
|
||||
repeat({ delay: 250 }),
|
||||
withLatestFrom(push$)
|
||||
)
|
||||
.subscribe(([, { prev }]) => {
|
||||
|
Loading…
Reference in New Issue
Block a user