🎨 search
This commit is contained in:
parent
d672d408b3
commit
d5dfa240f5
1 changed files with 3 additions and 0 deletions
|
@ -51,6 +51,7 @@ import {getUnRefList, openSearchUnRef, unRefMoreMenu} from "./unRef";
|
|||
import {getDefaultType} from "./getDefault";
|
||||
import {isSupportCSSHL, searchMarkRender} from "../protyle/render/searchMarkRender";
|
||||
import {saveKeyList, toggleAssetHistory, toggleReplaceHistory, toggleSearchHistory} from "./toggleHistory";
|
||||
import {highlightById} from "../util/highlightById";
|
||||
|
||||
export const openGlobalSearch = (app: App, text: string, replace: boolean, searchData?: Config.IUILayoutTabSearchConfig) => {
|
||||
text = text.trim();
|
||||
|
@ -1101,6 +1102,8 @@ export const getArticle = (options: {
|
|||
searchMarkRender(options.edit.protyle, getResponse.data.keywords, options.id, () => {
|
||||
if (options.edit.protyle.highlight.ranges.length > 0 && options.edit.protyle.highlight.ranges[options.edit.protyle.highlight.rangeIndex]) {
|
||||
options.edit.protyle.contentElement.scrollTop = options.edit.protyle.contentElement.scrollTop + options.edit.protyle.highlight.ranges[options.edit.protyle.highlight.rangeIndex].getBoundingClientRect().top - contentRect.top - contentRect.height / 2;
|
||||
} else {
|
||||
highlightById(options.edit.protyle, options.id);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue