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>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% 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"] %}
|
{% for path in config["extra_javascript"] %}
|
||||||
<script src="{{ path | url }}"></script>
|
<script src="{{ path | url }}"></script>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -229,7 +229,7 @@ const content$ = defer(() => merge(
|
|||||||
|
|
||||||
/* Table of contents */
|
/* Table of contents */
|
||||||
...getComponentElements("toc")
|
...getComponentElements("toc")
|
||||||
.map(el => mountTableOfContents(el, { viewport$, header$ })),
|
.map(el => mountTableOfContents(el, { viewport$, header$, target$ })),
|
||||||
|
|
||||||
/* Back-to-top button */
|
/* Back-to-top button */
|
||||||
...getComponentElements("top")
|
...getComponentElements("top")
|
||||||
|
@ -32,7 +32,9 @@ import {
|
|||||||
finalize,
|
finalize,
|
||||||
map,
|
map,
|
||||||
of,
|
of,
|
||||||
|
repeat,
|
||||||
scan,
|
scan,
|
||||||
|
skip,
|
||||||
startWith,
|
startWith,
|
||||||
switchMap,
|
switchMap,
|
||||||
takeLast,
|
takeLast,
|
||||||
@ -83,6 +85,7 @@ interface WatchOptions {
|
|||||||
interface MountOptions {
|
interface MountOptions {
|
||||||
viewport$: Observable<Viewport> /* Viewport observable */
|
viewport$: Observable<Viewport> /* Viewport observable */
|
||||||
header$: Observable<Header> /* Header 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
|
* @returns Table of contents component observable
|
||||||
*/
|
*/
|
||||||
export function mountTableOfContents(
|
export function mountTableOfContents(
|
||||||
el: HTMLElement, { viewport$, header$ }: MountOptions
|
el: HTMLElement, { viewport$, header$, target$ }: MountOptions
|
||||||
): Observable<Component<TableOfContents>> {
|
): Observable<Component<TableOfContents>> {
|
||||||
return defer(() => {
|
return defer(() => {
|
||||||
const push$ = new Subject<TableOfContents>()
|
const push$ = new Subject<TableOfContents>()
|
||||||
@ -278,6 +281,9 @@ export function mountTableOfContents(
|
|||||||
takeUntil(push$.pipe(takeLast(1))),
|
takeUntil(push$.pipe(takeLast(1))),
|
||||||
distinctUntilKeyChanged("offset"),
|
distinctUntilKeyChanged("offset"),
|
||||||
debounceTime(250),
|
debounceTime(250),
|
||||||
|
skip(1),
|
||||||
|
takeUntil(target$.pipe(skip(1))),
|
||||||
|
repeat({ delay: 250 }),
|
||||||
withLatestFrom(push$)
|
withLatestFrom(push$)
|
||||||
)
|
)
|
||||||
.subscribe(([, { prev }]) => {
|
.subscribe(([, { prev }]) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user