mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
🎨 Return document blocks when the keyword search hits different block content https://github.com/siyuan-note/siyuan/issues/10584
This commit is contained in:
@@ -204,7 +204,11 @@ ${unicode2Emoji(childItem.ial.icon, "b3-list-item__graphic", true)}
|
||||
listElement.scrollTop = 0;
|
||||
let countHTML = "";
|
||||
if (response) {
|
||||
countHTML = `<span class="fn__flex-center">${window.siyuan.languages.findInDoc.replace("${x}", response.data.matchedRootCount).replace("${y}", response.data.matchedBlockCount)}</span>
|
||||
let text = window.siyuan.languages.findInDoc.replace("${x}", response.data.matchedRootCount).replace("${y}", response.data.matchedBlockCount);
|
||||
if (response.data.docMode) {
|
||||
text = window.siyuan.languages.matchDoc.replace("${x}", response.data.matchedRootCount);
|
||||
}
|
||||
countHTML = `<span class="fn__flex-center">${text}</span>
|
||||
<span class="fn__flex-1"></span>
|
||||
<span class="fn__flex-center">${config.page}/${response.data.pageCount || 1}</span>`;
|
||||
}
|
||||
|
||||
@@ -1367,8 +1367,12 @@ export const inputEvent = (element: Element, config: Config.IUILayoutTabSearchCo
|
||||
nextElement.setAttribute("disabled", "disabled");
|
||||
}
|
||||
onSearch(response.data.blocks, edit, element, config);
|
||||
let text = window.siyuan.languages.findInDoc.replace("${x}", response.data.matchedRootCount).replace("${y}", response.data.matchedBlockCount);
|
||||
if (response.data.docMode) {
|
||||
text = window.siyuan.languages.matchDoc.replace("${x}", response.data.matchedRootCount);
|
||||
}
|
||||
searchResultElement.innerHTML = `${config.page}/${response.data.pageCount || 1}<span class="fn__space"></span>
|
||||
<span class="ft__on-surface">${window.siyuan.languages.findInDoc.replace("${x}", response.data.matchedRootCount).replace("${y}", response.data.matchedBlockCount)}</span>`;
|
||||
<span class="ft__on-surface">${text}</span>`;
|
||||
loadingElement.classList.add("fn__none");
|
||||
searchResultElement.setAttribute("data-pagecount", response.data.pageCount || 1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user