mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-05 20:30:15 +01:00
This commit is contained in:
parent
e1b45b40e5
commit
1d1f46892f
3 changed files with 30 additions and 15 deletions
|
|
@ -189,7 +189,10 @@ export class Search extends Model {
|
|||
size: foldResponse.data ? Constants.SIZE_GET_MAX : Constants.SIZE_GET,
|
||||
}, getResponse => {
|
||||
onGet(getResponse, this.protyle.protyle, foldResponse.data ? [Constants.CB_GET_ALL] : [Constants.CB_GET_HL]);
|
||||
this.protyle.protyle.wysiwyg.element.querySelector(`div[data-node-id="${id}"] span[data-type="search-mark"]`).scrollIntoView();
|
||||
const matchElement = this.protyle.protyle.wysiwyg.element.querySelector(`div[data-node-id="${id}"] span[data-type="search-mark"]`)
|
||||
if (matchElement) {
|
||||
matchElement.scrollIntoView();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.protyle = new Protyle(this.element.querySelector("#searchPreview") as HTMLElement, {
|
||||
|
|
@ -201,7 +204,10 @@ export class Search extends Model {
|
|||
breadcrumbDocName: true,
|
||||
},
|
||||
after: () => {
|
||||
this.protyle.protyle.wysiwyg.element.querySelector(`div[data-node-id="${id}"] span[data-type="search-mark"]`).scrollIntoView();
|
||||
const matchElement = this.protyle.protyle.wysiwyg.element.querySelector(`div[data-node-id="${id}"] span[data-type="search-mark"]`)
|
||||
if (matchElement) {
|
||||
matchElement.scrollIntoView();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -648,7 +648,10 @@ const getArticle = (options: {
|
|||
breadcrumbDocName: true
|
||||
},
|
||||
after: () => {
|
||||
protyle.protyle.wysiwyg.element.querySelector(`div[data-node-id="${options.id}"] span[data-type="search-mark"]`).scrollIntoView();
|
||||
const matchElement = protyle.protyle.wysiwyg.element.querySelector(`div[data-node-id="${options.id}"] span[data-type="search-mark"]`)
|
||||
if (matchElement) {
|
||||
matchElement.scrollIntoView();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
@ -661,7 +664,10 @@ const getArticle = (options: {
|
|||
size: foldResponse.data ? Constants.SIZE_GET_MAX : Constants.SIZE_GET,
|
||||
}, getResponse => {
|
||||
onGet(getResponse, protyle.protyle, foldResponse.data ? [Constants.CB_GET_ALL] : [Constants.CB_GET_HL]);
|
||||
protyle.protyle.wysiwyg.element.querySelector(`div[data-node-id="${options.id}"] span[data-type="search-mark"]`).scrollIntoView();
|
||||
const matchElement = protyle.protyle.wysiwyg.element.querySelector(`div[data-node-id="${options.id}"] span[data-type="search-mark"]`)
|
||||
if (matchElement) {
|
||||
matchElement.scrollIntoView();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue