mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-23 06:13:38 -04:00
Fixed multi-language search
This commit is contained in:
@@ -54,9 +54,7 @@ import {
|
||||
watchViewport,
|
||||
watchKeyboard,
|
||||
watchToggleMap,
|
||||
useToggle,
|
||||
getActiveElement,
|
||||
mayReceiveKeyboardEvents
|
||||
useToggle
|
||||
} from "./observables"
|
||||
import { setupSearchWorker } from "./workers"
|
||||
|
||||
|
||||
@@ -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)
|
||||
)
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user