Fixed localsearch integration

This commit is contained in:
squidfunk
2021-03-01 20:08:59 +01:00
parent 108100277c
commit eb35ab949c
9 changed files with 19 additions and 23 deletions

View File

@@ -130,13 +130,13 @@ export function createElement<T extends keyof HTMLElementTagNameMap>(
}
/**
* Replace an element with another element
* Replace an element with the given list of nodes
*
* @param source - Source element
* @param target - Target element
* @param el - Element
* @param nodes - Replacement nodes
*/
export function replaceElement(
source: HTMLElement, target: Node
el: HTMLElement, ...nodes: Node[]
): void {
source.replaceWith(target)
el.replaceWith(...nodes)
}

View File

@@ -84,10 +84,6 @@ interface MountOptions {
export function mountSearch(
el: HTMLElement, { index$, keyboard$ }: MountOptions
): Observable<Component<Search>> {
if (location.protocol === "file:")
return NEVER
/* Set up search worker */
const config = configuration()
const worker = setupSearchWorker(config.search, index$)