mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-23 08:46:09 +01:00
This commit is contained in:
parent
eea07195c6
commit
add48a9983
2 changed files with 7 additions and 3 deletions
|
|
@ -1234,7 +1234,7 @@ export const inputEvent = (element: Element, config: Config.IUILayoutTabSearchCo
|
|||
const loadingElement = element.querySelector(".fn__loading--top");
|
||||
loadingElement.classList.remove("fn__none");
|
||||
const searchInputElement = element.querySelector("#searchInput") as HTMLInputElement;
|
||||
const inputValue = searchInputElement.value;
|
||||
config.query = searchInputElement.value;
|
||||
element.querySelector("#searchList").scrollTo(0, 0);
|
||||
const previousElement = element.querySelector('[data-type="previous"]');
|
||||
const nextElement = element.querySelector('[data-type="next"]');
|
||||
|
|
@ -1246,7 +1246,7 @@ export const inputEvent = (element: Element, config: Config.IUILayoutTabSearchCo
|
|||
});
|
||||
});
|
||||
const searchResultElement = element.querySelector("#searchResult");
|
||||
if (inputValue === "" && (!config.idPath || config.idPath.length === 0)) {
|
||||
if (config.query === "" && (!config.idPath || config.idPath.length === 0)) {
|
||||
fetchPost("/api/block/getRecentUpdatedBlocks", {}, (response) => {
|
||||
if (window.siyuan.reqIds["/api/block/getRecentUpdatedBlocks"] && window.siyuan.reqIds["/api/search/fullTextSearchBlock"] &&
|
||||
window.siyuan.reqIds["/api/block/getRecentUpdatedBlocks"] < window.siyuan.reqIds["/api/search/fullTextSearchBlock"]) {
|
||||
|
|
@ -1265,7 +1265,7 @@ export const inputEvent = (element: Element, config: Config.IUILayoutTabSearchCo
|
|||
previousElement.setAttribute("disabled", "disabled");
|
||||
}
|
||||
fetchPost("/api/search/fullTextSearchBlock", {
|
||||
query: inputValue,
|
||||
query: config.query,
|
||||
method: config.method,
|
||||
types: config.types,
|
||||
paths: config.idPath || [],
|
||||
|
|
|
|||
4
app/src/types/config.d.ts
vendored
4
app/src/types/config.d.ts
vendored
|
|
@ -2058,6 +2058,10 @@ declare namespace Config {
|
|||
* SiYuan search tab configuration
|
||||
*/
|
||||
export interface IUILayoutTabSearchConfig {
|
||||
/**
|
||||
* 搜索传入的查询内容
|
||||
*/
|
||||
query?: string;
|
||||
/**
|
||||
* Grouping strategy
|
||||
* - `0`: No grouping
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue