mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-25 17:56:09 +01:00
This commit is contained in:
parent
7ac33b0a34
commit
a21831eb9a
3 changed files with 14 additions and 4 deletions
|
|
@ -159,7 +159,11 @@ export class BlockPanel {
|
|||
const action = [];
|
||||
if (response.data.rootID !== this.nodeIds[index]) {
|
||||
action.push(Constants.CB_GET_ALL);
|
||||
} else {
|
||||
action.push(Constants.CB_GET_SCROLL);
|
||||
action.push(Constants.CB_GET_HL);
|
||||
}
|
||||
|
||||
if (this.isBacklink) {
|
||||
action.push(Constants.CB_GET_BACKLINK);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,11 +216,17 @@ export class Protyle {
|
|||
return;
|
||||
}
|
||||
if (options.scrollAttr ||
|
||||
mergedOptions.action.includes(Constants.CB_GET_CONTEXT) ||
|
||||
(mergedOptions.action.includes(Constants.CB_GET_SCROLL) && this.protyle.options.mode !== "preview")) {
|
||||
if (!options.scrollAttr) {
|
||||
fetchPost("/api/block/getDocInfo", {
|
||||
id: options.blockId
|
||||
}, (response) => {
|
||||
if (response.data.rootID !== options.blockId && mergedOptions.action.includes(Constants.CB_GET_CONTEXT)) {
|
||||
// 搜索打开文档等情况需保持上一次历史 https://github.com/siyuan-note/siyuan/issues/9082
|
||||
this.getDoc(mergedOptions);
|
||||
return;
|
||||
}
|
||||
let scrollObj;
|
||||
if (response.data.ial.scroll) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -756,7 +756,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
|
|||
openFileById({
|
||||
app,
|
||||
id,
|
||||
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL],
|
||||
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],
|
||||
zoomIn: foldResponse.data,
|
||||
position: "right"
|
||||
});
|
||||
|
|
@ -796,7 +796,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
|
|||
openFileById({
|
||||
app,
|
||||
id,
|
||||
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL],
|
||||
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],
|
||||
zoomIn: foldResponse.data
|
||||
});
|
||||
if (closeCB) {
|
||||
|
|
@ -855,7 +855,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
|
|||
app,
|
||||
id,
|
||||
position: "right",
|
||||
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL],
|
||||
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],
|
||||
zoomIn: foldResponse.data
|
||||
});
|
||||
if (closeCB) {
|
||||
|
|
@ -884,7 +884,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
|
|||
openFileById({
|
||||
app,
|
||||
id,
|
||||
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL],
|
||||
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],
|
||||
zoomIn: foldResponse.data
|
||||
});
|
||||
if (closeCB) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue