|
@@ -643,17 +643,19 @@ const getArticle = (options: {
|
|
if (!protyle) {
|
|
if (!protyle) {
|
|
protyle = new Protyle(options.dialog.element.querySelector("#searchPreview") as HTMLElement, {
|
|
protyle = new Protyle(options.dialog.element.querySelector("#searchPreview") as HTMLElement, {
|
|
blockId: options.id,
|
|
blockId: options.id,
|
|
- action: foldResponse.data ? [Constants.CB_GET_HL, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT],
|
|
|
|
|
|
+ action: foldResponse.data ? [Constants.CB_GET_HL, Constants.CB_GET_ALL, Constants.CB_GET_HTML] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_HTML],
|
|
key: options.k,
|
|
key: options.k,
|
|
render: {
|
|
render: {
|
|
gutter: true,
|
|
gutter: true,
|
|
breadcrumbDocName: true
|
|
breadcrumbDocName: true
|
|
},
|
|
},
|
|
after: () => {
|
|
after: () => {
|
|
- const matchElement = protyle.protyle.wysiwyg.element.querySelector(`div[data-node-id="${options.id}"] span[data-type="search-mark"]`);
|
|
|
|
- if (matchElement) {
|
|
|
|
- matchElement.scrollIntoView();
|
|
|
|
- }
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ const matchElement = protyle.protyle.wysiwyg.element.querySelector(`div[data-node-id="${options.id}"] span[data-type="search-mark"]`);
|
|
|
|
+ if (matchElement) {
|
|
|
|
+ matchElement.scrollIntoView();
|
|
|
|
+ }
|
|
|
|
+ }, Constants.TIMEOUT_SEARCH);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
@@ -665,7 +667,7 @@ const getArticle = (options: {
|
|
mode: foldResponse.data ? 0 : 3,
|
|
mode: foldResponse.data ? 0 : 3,
|
|
size: foldResponse.data ? Constants.SIZE_GET_MAX : Constants.SIZE_GET,
|
|
size: foldResponse.data ? Constants.SIZE_GET_MAX : Constants.SIZE_GET,
|
|
}, getResponse => {
|
|
}, getResponse => {
|
|
- onGet(getResponse, protyle.protyle, foldResponse.data ? [Constants.CB_GET_ALL] : [Constants.CB_GET_HL]);
|
|
|
|
|
|
+ onGet(getResponse, protyle.protyle, foldResponse.data ? [Constants.CB_GET_ALL, Constants.CB_GET_HTML] : [Constants.CB_GET_HL, Constants.CB_GET_HTML]);
|
|
const matchElement = protyle.protyle.wysiwyg.element.querySelector(`div[data-node-id="${options.id}"] span[data-type="search-mark"]`);
|
|
const matchElement = protyle.protyle.wysiwyg.element.querySelector(`div[data-node-id="${options.id}"] span[data-type="search-mark"]`);
|
|
if (matchElement) {
|
|
if (matchElement) {
|
|
matchElement.scrollIntoView();
|
|
matchElement.scrollIntoView();
|