mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-29 12:58:48 +01:00
This commit is contained in:
parent
4cdc96eca7
commit
fd38d4e1f0
2 changed files with 8 additions and 0 deletions
|
|
@ -542,6 +542,11 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()
|
|||
inputTimeout = inputEvent(element, config, inputTimeout, edit, event);
|
||||
});
|
||||
searchInputElement.addEventListener("blur", () => {
|
||||
if (config.removed) {
|
||||
config.k = searchInputElement.value;
|
||||
window.siyuan.storage[Constants.LOCAL_SEARCHDATA] = Object.assign({}, config);
|
||||
setStorageVal(Constants.LOCAL_SEARCHDATA, window.siyuan.storage[Constants.LOCAL_SEARCHDATA]);
|
||||
}
|
||||
saveKeyList("keys", searchInputElement.value);
|
||||
});
|
||||
searchInputElement.addEventListener("keydown", (event: KeyboardEvent) => {
|
||||
|
|
@ -825,6 +830,7 @@ const addConfigMoreMenu = async (config: ISearchOption, edit: Protyle, element:
|
|||
}
|
||||
return;
|
||||
}
|
||||
config.removed = false;
|
||||
updateConfig(element, item, config, edit);
|
||||
});
|
||||
}
|
||||
|
|
@ -841,6 +847,7 @@ const addConfigMoreMenu = async (config: ISearchOption, edit: Protyle, element:
|
|||
label: window.siyuan.languages.removeCriterion,
|
||||
click() {
|
||||
updateConfig(element, {
|
||||
removed: true,
|
||||
sort: 0,
|
||||
group: 0,
|
||||
hasReplace: false,
|
||||
|
|
|
|||
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
|
@ -81,6 +81,7 @@ interface ICard {
|
|||
}
|
||||
|
||||
interface ISearchOption {
|
||||
removed?: boolean // 移除后需记录搜索内容 https://github.com/siyuan-note/siyuan/issues/7745
|
||||
name?: string
|
||||
sort: number, // 0:按块类型(默认),1:按创建时间升序,2:按创建时间降序,3:按更新时间升序,4:按更新时间降序,5:按内容顺序(仅在按文档分组时),6:按相关度升序,7:按相关度降序
|
||||
group: number, // 0:不分组,1:按文档分组
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue