mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 15:21:01 +08:00
This commit is contained in:
parent
c62e178652
commit
688cf9a708
@ -53,21 +53,17 @@ const replace = (element: Element, config: Config.IUILayoutTabSearchConfig, isAl
|
|||||||
}
|
}
|
||||||
loadElement.classList.remove("fn__none");
|
loadElement.classList.remove("fn__none");
|
||||||
loadElement.nextElementSibling.classList.add("fn__none");
|
loadElement.nextElementSibling.classList.add("fn__none");
|
||||||
let ids: string[] = [];
|
|
||||||
if (isAll) {
|
|
||||||
searchListElement.querySelectorAll('.b3-list-item[data-type="search-item"]').forEach(item => {
|
|
||||||
ids.push(item.getAttribute("data-node-id"));
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
ids = [currentLiElement.getAttribute("data-node-id")];
|
|
||||||
}
|
|
||||||
fetchPost("/api/search/findReplace", {
|
fetchPost("/api/search/findReplace", {
|
||||||
k: config.method === 0 ? getKeyByLiElement(currentLiElement) : (document.querySelector("#toolbarSearch") as HTMLInputElement).value,
|
k: config.method === 0 ? getKeyByLiElement(currentLiElement) : (document.querySelector("#toolbarSearch") as HTMLInputElement).value,
|
||||||
r: replaceInputElement.value,
|
r: replaceInputElement.value,
|
||||||
ids,
|
ids: isAll ? [] : [currentLiElement.getAttribute("data-node-id")],
|
||||||
types: config.types,
|
types: config.types,
|
||||||
method: config.method,
|
method: config.method,
|
||||||
replaceTypes: config.replaceTypes
|
replaceTypes: config.replaceTypes,
|
||||||
|
paths: config.idPath || [],
|
||||||
|
groupBy: config.group,
|
||||||
|
orderBy: config.sort,
|
||||||
|
page: config.page,
|
||||||
}, (response) => {
|
}, (response) => {
|
||||||
loadElement.classList.add("fn__none");
|
loadElement.classList.add("fn__none");
|
||||||
loadElement.nextElementSibling.classList.remove("fn__none");
|
loadElement.nextElementSibling.classList.remove("fn__none");
|
||||||
@ -76,7 +72,8 @@ const replace = (element: Element, config: Config.IUILayoutTabSearchConfig, isAl
|
|||||||
showMessage(response.msg);
|
showMessage(response.msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ids.length > 1) {
|
if (isAll) {
|
||||||
|
updateSearchResult(config, element);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
reloadProtyle(window.siyuan.mobile.editor.protyle, false);
|
reloadProtyle(window.siyuan.mobile.editor.protyle, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user