Fixed multi-language search

This commit is contained in:
squidfunk
2020-02-19 15:45:52 +01:00
parent 8171fc0ecd
commit 577ad4ccc4
14 changed files with 36 additions and 35 deletions

View File

@@ -54,9 +54,7 @@ import {
watchViewport,
watchKeyboard,
watchToggleMap,
useToggle,
getActiveElement,
mayReceiveKeyboardEvents
useToggle
} from "./observables"
import { setupSearchWorker } from "./workers"

View File

@@ -70,10 +70,14 @@ export function setupClipboard(
})
/* Initialize and setup clipboard */
return fromEventPattern<ClipboardJS.Event>(next => {
const clipboard = new ClipboardJS(".md-clipboard")
clipboard.on("success", next)
const clipboard$ = fromEventPattern<ClipboardJS.Event>(next => {
new ClipboardJS(".md-clipboard").on("success", next)
})
// TODO: integrate rendering of dialog
/* */
return clipboard$
.pipe(
shareReplay(1)
)

View File

@@ -20,6 +20,8 @@
* IN THE SOFTWARE.
*/
import "expose-loader?lunr!lunr"
import { SearchIndex, SearchIndexConfig } from "integrations/search"
import { SearchMessage, SearchMessageType } from "../message"
@@ -56,7 +58,7 @@ function setupLunrLanguages(config: SearchIndexConfig): void {
}
/* Add multi-language support */
if (scripts.length > 1)
if (config.lang.length > 1)
scripts.push(`${base}/min/lunr.multi.min.js`)
/* Load scripts synchronously */