mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-23 16:56:10 +01:00
♻️
This commit is contained in:
parent
400313b177
commit
bb82261522
1 changed files with 3 additions and 3 deletions
|
|
@ -5,7 +5,7 @@ import {fetchPost} from "../../util/fetch";
|
|||
import {getIconByType} from "../../editor/getIcon";
|
||||
import {preventScroll} from "../../protyle/scroll/preventScroll";
|
||||
|
||||
const onRecentblocks = (data: IBlock[], matchedRootCount?:number, matchedBlockCount?:number) => {
|
||||
const onRecentBlocks = (data: IBlock[], matchedRootCount?:number, matchedBlockCount?:number) => {
|
||||
let resultHTML = "";
|
||||
if (matchedBlockCount) {
|
||||
resultHTML = '<div class="b3-list-item ft__smaller ft__on-surface">' + window.siyuan.languages.findInDoc.replace("${x}", matchedRootCount).replace("${y}", matchedBlockCount) + "</div>";
|
||||
|
|
@ -30,11 +30,11 @@ const toolbarSearchEvent = () => {
|
|||
const inputElement = document.getElementById("toolbarSearch") as HTMLInputElement;
|
||||
if (inputElement.value === "") {
|
||||
fetchPost("/api/block/getRecentUpdatedBlocks", {}, (response) => {
|
||||
onRecentblocks(response.data);
|
||||
onRecentBlocks(response.data);
|
||||
});
|
||||
} else {
|
||||
fetchPost("/api/search/fullTextSearchBlock", {query: inputElement.value,}, (response) => {
|
||||
onRecentblocks(response.data.blocks, response.data.matchedRootCount,response.data.matchedBlockCount);
|
||||
onRecentBlocks(response.data.blocks, response.data.matchedRootCount,response.data.matchedBlockCount);
|
||||
});
|
||||
}
|
||||
const localData = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEDATA) || "{}");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue