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,
|
take,
|
||||||
shareReplay,
|
shareReplay,
|
||||||
share,
|
share,
|
||||||
pluck
|
pluck,
|
||||||
|
skip
|
||||||
} from "rxjs/operators"
|
} from "rxjs/operators"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -352,8 +353,16 @@ export function initialize(config: unknown) {
|
|||||||
if (config.features.includes("instant")) {
|
if (config.features.includes("instant")) {
|
||||||
|
|
||||||
/* Disable automatic scroll restoration, as it doesn't work nicely */
|
/* 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)
|
if ("scrollRestoration" in history)
|
||||||
history.scrollRestoration = "manual"
|
history.scrollRestoration = "manual"
|
||||||
|
})
|
||||||
|
|
||||||
/* Resolve relative links for stability */
|
/* Resolve relative links for stability */
|
||||||
for (const selector of [
|
for (const selector of [
|
||||||
|
@ -135,7 +135,6 @@ export function setupInstantLoading(
|
|||||||
)
|
)
|
||||||
.subscribe(location$)
|
.subscribe(location$)
|
||||||
|
|
||||||
|
|
||||||
const dom = new DOMParser()
|
const dom = new DOMParser()
|
||||||
const ajax$ = location$
|
const ajax$ = location$
|
||||||
.pipe(
|
.pipe(
|
||||||
|
Loading…
Reference in New Issue
Block a user