mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-10 06:32:33 +01:00
This commit is contained in:
parent
4bf7b49beb
commit
60f6bf9a64
9 changed files with 203 additions and 139 deletions
|
|
@ -616,7 +616,18 @@ const initSearchEvent = (app: App, element: Element, config: Config.IUILayoutTab
|
|||
}, false);
|
||||
};
|
||||
|
||||
export const popSearch = (app: App, config = window.siyuan.storage[Constants.LOCAL_SEARCHDATA] as Config.IUILayoutTabSearchConfig) => {
|
||||
export const popSearch = (app: App, searchConfig?: any) => {
|
||||
const config: Config.IUILayoutTabSearchConfig = JSON.parse(JSON.stringify(window.siyuan.storage[Constants.LOCAL_SEARCHDATA]));
|
||||
const rangeText = (getCurrentEditor()?.protyle.toolbar.range || (getSelection().rangeCount > 0 ? getSelection().getRangeAt(0) : document.createRange())).toString()
|
||||
if (rangeText) {
|
||||
config.k = rangeText;
|
||||
}
|
||||
if (searchConfig) {
|
||||
Object.keys(searchConfig).forEach((key: "r") => {
|
||||
config[key] = searchConfig[key];
|
||||
});
|
||||
}
|
||||
|
||||
activeBlur();
|
||||
hideKeyboardToolbar();
|
||||
let includeChild = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue