mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-23 14:23:39 -04:00
Added loading of sitemap to filter instant loading requests
This commit is contained in:
@@ -100,7 +100,7 @@ interface SetupOptions {
|
||||
* @param options - Options
|
||||
*/
|
||||
export function setupInstantLoading(
|
||||
{ document$, viewport$, location$ }: SetupOptions
|
||||
urls: string[], { document$, viewport$, location$ }: SetupOptions
|
||||
): void {
|
||||
|
||||
/* Disable automatic scroll restoration */
|
||||
@@ -125,7 +125,11 @@ export function setupInstantLoading(
|
||||
switchMap(ev => {
|
||||
if (ev.target instanceof HTMLElement) {
|
||||
const el = ev.target.closest("a")
|
||||
if (el && !el.target && isLocalLocation(el)) {
|
||||
if (
|
||||
el && !el.target &&
|
||||
isLocalLocation(el) &&
|
||||
urls.includes(el.href)
|
||||
) {
|
||||
if (!isAnchorLocation(el))
|
||||
ev.preventDefault()
|
||||
return of(el)
|
||||
|
||||
Reference in New Issue
Block a user