mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed linting errors and enabled instant loading
This commit is contained in:
parent
f81ae11d59
commit
f38d0a8d64
@ -47,7 +47,8 @@ import {
|
||||
take,
|
||||
shareReplay,
|
||||
share,
|
||||
pluck
|
||||
pluck,
|
||||
skip
|
||||
} from "rxjs/operators"
|
||||
|
||||
import {
|
||||
@ -352,8 +353,16 @@ export function initialize(config: unknown) {
|
||||
if (config.features.includes("instant")) {
|
||||
|
||||
/* Disable automatic scroll restoration, as it doesn't work nicely */
|
||||
location$
|
||||
.pipe(
|
||||
skip(1),
|
||||
take(1)
|
||||
)
|
||||
.subscribe(() => {
|
||||
console.log("disabled automatic scroll restoration")
|
||||
if ("scrollRestoration" in history)
|
||||
history.scrollRestoration = "manual"
|
||||
})
|
||||
|
||||
/* Resolve relative links for stability */
|
||||
for (const selector of [
|
||||
|
@ -135,7 +135,6 @@ export function setupInstantLoading(
|
||||
)
|
||||
.subscribe(location$)
|
||||
|
||||
|
||||
const dom = new DOMParser()
|
||||
const ajax$ = location$
|
||||
.pipe(
|
||||
|
Loading…
Reference in New Issue
Block a user