This commit is contained in:
Vanessa 2023-09-17 22:26:30 +08:00
parent 58d1978eb8
commit 72f28947d2
18 changed files with 80 additions and 76 deletions

View file

@ -156,7 +156,7 @@ export class BlockPanel {
if (response.data.rootID !== this.nodeIds[index]) { if (response.data.rootID !== this.nodeIds[index]) {
action.push(Constants.CB_GET_ALL); action.push(Constants.CB_GET_ALL);
} else { } else {
action.push(Constants.CB_GET_SCROLL); action.push(Constants.CB_GET_CONTEXT);
action.push(Constants.CB_GET_HL); action.push(Constants.CB_GET_HL);
} }

View file

@ -281,7 +281,7 @@ export const initWindow = (app: App) => {
openFileById({ openFileById({
app, app,
id, id,
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
zoomIn: focus, zoomIn: focus,
}); });
ipcRenderer.send(Constants.SIYUAN_SHOW, getCurrentWindow().id); ipcRenderer.send(Constants.SIYUAN_SHOW, getCurrentWindow().id);

View file

@ -69,6 +69,7 @@ export abstract class Constants {
public static readonly CB_GET_UNUNDO = "cb-get-unundo"; // 不需要记录历史 public static readonly CB_GET_UNUNDO = "cb-get-unundo"; // 不需要记录历史
public static readonly CB_GET_SCROLL = "cb-get-scroll"; // 滚动到指定位置 public static readonly CB_GET_SCROLL = "cb-get-scroll"; // 滚动到指定位置
public static readonly CB_GET_CONTEXT = "cb-get-context"; // 包含上下文 public static readonly CB_GET_CONTEXT = "cb-get-context"; // 包含上下文
public static readonly CB_GET_ROOTSCROLL = "cb-get-rootscroll"; // 如果为 rootID 就滚动到指定位置
public static readonly CB_GET_HTML = "cb-get-html"; // 直接渲染,不需要再 /api/block/getDocInfo否则搜索表格无法定位 public static readonly CB_GET_HTML = "cb-get-html"; // 直接渲染,不需要再 /api/block/getDocInfo否则搜索表格无法定位
public static readonly CB_GET_HISTORY = "cb-get-history"; // 历史渲染 public static readonly CB_GET_HISTORY = "cb-get-history"; // 历史渲染

View file

@ -190,7 +190,7 @@ window.openFileByURL = (openURL) => {
openFileById({ openFileById({
app: siyuanApp, app: siyuanApp,
id: getIdFromSYProtocol(openURL), id: getIdFromSYProtocol(openURL),
action: isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
zoomIn: isZoomIn zoomIn: isZoomIn
}); });
return true; return true;

View file

@ -474,7 +474,7 @@ export class Wnd {
openFileById({ openFileById({
app: this.app, app: this.app,
id: keepCursorId, id: keepCursorId,
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT] action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]
}); });
} }
currentTab.headElement.removeAttribute("keep-cursor"); currentTab.headElement.removeAttribute("keep-cursor");

View file

@ -89,7 +89,7 @@ export class Bookmark extends Model {
openFileById({ openFileById({
app, app,
id, id,
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
zoomIn: foldResponse.data zoomIn: foldResponse.data
}); });
}); });
@ -103,7 +103,7 @@ export class Bookmark extends Model {
app, app,
id: element.getAttribute("data-node-id"), id: element.getAttribute("data-node-id"),
keepCursor: true, keepCursor: true,
action: [Constants.CB_GET_CONTEXT] action: [Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]
}); });
}, },
altClick(element: HTMLElement) { altClick(element: HTMLElement) {
@ -111,7 +111,7 @@ export class Bookmark extends Model {
app, app,
id: element.getAttribute("data-node-id"), id: element.getAttribute("data-node-id"),
position: "right", position: "right",
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT] action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]
}); });
}, },
shiftClick(element: HTMLElement) { shiftClick(element: HTMLElement) {
@ -119,7 +119,7 @@ export class Bookmark extends Model {
app, app,
id: element.getAttribute("data-node-id"), id: element.getAttribute("data-node-id"),
position: "bottom", position: "bottom",
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT] action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]
}); });
}, },
blockExtHTML: '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>', blockExtHTML: '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>',

View file

@ -653,14 +653,14 @@ export class Graph extends Model {
app: this.app, app: this.app,
id: node.id, id: node.id,
position: "bottom", position: "bottom",
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT] action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]
}); });
} else if (window.siyuan.altIsPressed) { } else if (window.siyuan.altIsPressed) {
openFileById({ openFileById({
app: this.app, app: this.app,
id: node.id, id: node.id,
position: "right", position: "right",
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT] action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]
}); });
} else if (window.siyuan.ctrlIsPressed) { } else if (window.siyuan.ctrlIsPressed) {
window.siyuan.blockPanels.push(new BlockPanel({ window.siyuan.blockPanels.push(new BlockPanel({
@ -674,7 +674,7 @@ export class Graph extends Model {
openFileById({ openFileById({
app: this.app, app: this.app,
id: node.id, id: node.id,
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT] action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]
}); });
} }
}); });

View file

@ -435,7 +435,7 @@ export const JSONToLayout = (app: App, isStart: boolean) => {
openFileById({ openFileById({
app, app,
id: idZoomIn.id, id: idZoomIn.id,
action: idZoomIn.isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: idZoomIn.isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
zoomIn: idZoomIn.isZoomIn zoomIn: idZoomIn.isZoomIn
}); });
} else { } else {

View file

@ -193,7 +193,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
openFileById({ openFileById({
app: protyle.app, app: protyle.app,
id: refBlockId, id: refBlockId,
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
zoomIn: foldResponse.data zoomIn: foldResponse.data
}); });
}); });
@ -207,7 +207,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
openFileById({ openFileById({
app: protyle.app, app: protyle.app,
id: refBlockId, id: refBlockId,
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
keepCursor: true, keepCursor: true,
zoomIn: foldResponse.data zoomIn: foldResponse.data
}); });
@ -224,7 +224,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
app: protyle.app, app: protyle.app,
id: refBlockId, id: refBlockId,
position: "right", position: "right",
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
zoomIn: foldResponse.data zoomIn: foldResponse.data
}); });
}); });
@ -240,7 +240,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
app: protyle.app, app: protyle.app,
id: refBlockId, id: refBlockId,
position: "bottom", position: "bottom",
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
zoomIn: foldResponse.data zoomIn: foldResponse.data
}); });
}); });

View file

@ -39,7 +39,7 @@ export class MobileBookmarks {
} }
} }
fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => { fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {
openMobileFileById(app, id, foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL, Constants.CB_GET_HTML] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SETID, Constants.CB_GET_CONTEXT, Constants.CB_GET_HTML]); openMobileFileById(app, id, foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
}); });
}, },
blockExtHTML: '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>', blockExtHTML: '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>',

View file

@ -130,7 +130,7 @@ window.hideKeyboardToolbar = hideKeyboardToolbar;
window.openFileByURL = (openURL) => { window.openFileByURL = (openURL) => {
if (openURL && isSYProtocol(openURL)) { if (openURL && isSYProtocol(openURL)) {
openMobileFileById(siyuanApp, getIdFromSYProtocol(openURL), openMobileFileById(siyuanApp, getIdFromSYProtocol(openURL),
getSearch("focus", openURL) === "1" ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]); getSearch("focus", openURL) === "1" ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
return true; return true;
} }
return false; return false;

View file

@ -560,7 +560,7 @@ const initSearchEvent = (app: App, element: Element, config: ISearchOption) => {
preventScroll(window.siyuan.mobile.editor.protyle); preventScroll(window.siyuan.mobile.editor.protyle);
} }
fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => { fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {
openMobileFileById(app, id, foldResponse.data ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]); openMobileFileById(app, id, foldResponse.data ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
}); });
closePanel(); closePanel();
} else { } else {

View file

@ -119,7 +119,7 @@ export const initFramework = (app: App) => {
const idZoomIn = getIdZoomInByPath(); const idZoomIn = getIdZoomInByPath();
if (idZoomIn.id) { if (idZoomIn.id) {
openMobileFileById(app, idZoomIn.id, openMobileFileById(app, idZoomIn.id,
idZoomIn.isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]); idZoomIn.isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
return; return;
} }
const localDoc = window.siyuan.storage[Constants.LOCAL_DOCINFO]; const localDoc = window.siyuan.storage[Constants.LOCAL_DOCINFO];
@ -129,7 +129,7 @@ export const initFramework = (app: App) => {
} else { } else {
fetchPost("/api/block/getRecentUpdatedBlocks", {}, (response) => { fetchPost("/api/block/getRecentUpdatedBlocks", {}, (response) => {
if (response.data.length !== 0) { if (response.data.length !== 0) {
openMobileFileById(app, response.data[0].id, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]); openMobileFileById(app, response.data[0].id, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
} else { } else {
setEmpty(app); setEmpty(app);
} }

View file

@ -216,15 +216,23 @@ export class Protyle {
removeLoading(this.protyle); removeLoading(this.protyle);
return; return;
} }
if (options.scrollAttr || if (options.scrollAttr) {
mergedOptions.action.includes(Constants.CB_GET_CONTEXT) || getDocByScroll({
(mergedOptions.action.includes(Constants.CB_GET_SCROLL) && this.protyle.options.mode !== "preview")) { protyle: this.protyle,
if (!options.scrollAttr) { scrollAttr: options.scrollAttr,
mergedOptions,
cb: () => {
this.afterOnGet(mergedOptions);
}
});
} else if (this.protyle.options.mode !== "preview" &&
(mergedOptions.action.includes(Constants.CB_GET_SCROLL) || mergedOptions.action.includes(Constants.CB_GET_ROOTSCROLL))) {
fetchPost("/api/block/getDocInfo", { fetchPost("/api/block/getDocInfo", {
id: options.blockId id: options.blockId
}, (response) => { }, (response) => {
if (response.data.rootID !== options.blockId && mergedOptions.action.includes(Constants.CB_GET_CONTEXT)) { if (!mergedOptions.action.includes(Constants.CB_GET_SCROLL) &&
// 搜索打开文档等情况需保持上一次历史 https://github.com/siyuan-note/siyuan/issues/9082 response.data.rootID !== options.blockId && mergedOptions.action.includes(Constants.CB_GET_ROOTSCROLL)) {
// 打开根文档保持上一次历史,否则按照原有 action 执行 https://github.com/siyuan-note/siyuan/issues/9082
this.getDoc(mergedOptions); this.getDoc(mergedOptions);
return; return;
} }
@ -250,16 +258,6 @@ export class Protyle {
this.getDoc(mergedOptions); this.getDoc(mergedOptions);
} }
}); });
} else {
getDocByScroll({
protyle: this.protyle,
scrollAttr: options.scrollAttr,
mergedOptions,
cb: () => {
this.afterOnGet(mergedOptions);
}
});
}
} else { } else {
this.getDoc(mergedOptions); this.getDoc(mergedOptions);
} }

View file

@ -259,6 +259,7 @@ const setHTML = (options: {
} }
// 屏幕太高的页签 https://github.com/siyuan-note/siyuan/issues/5018 // 屏幕太高的页签 https://github.com/siyuan-note/siyuan/issues/5018
if (!protyle.scroll.element.classList.contains("fn__none") && if (!protyle.scroll.element.classList.contains("fn__none") &&
!protyle.element.classList.contains("block__edit") && // 不能为浮窗,否则悬浮为根文档无法打开整个文档 https://github.com/siyuan-note/siyuan/issues/9082
protyle.wysiwyg.element.lastElementChild.getAttribute("data-eof") !== "2" && protyle.wysiwyg.element.lastElementChild.getAttribute("data-eof") !== "2" &&
protyle.contentElement.scrollHeight > 0 && // 没有激活的页签 https://github.com/siyuan-note/siyuan/issues/5255 protyle.contentElement.scrollHeight > 0 && // 没有激活的页签 https://github.com/siyuan-note/siyuan/issues/5255
!options.action.includes(Constants.CB_GET_FOCUSFIRST) && // 防止 eof 为true https://github.com/siyuan-note/siyuan/issues/5291 !options.action.includes(Constants.CB_GET_FOCUSFIRST) && // 防止 eof 为true https://github.com/siyuan-note/siyuan/issues/5291

View file

@ -1699,7 +1699,7 @@ export class WYSIWYG {
app: protyle.app, app: protyle.app,
id: refBlockId, id: refBlockId,
position: "bottom", position: "bottom",
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
zoomIn: foldResponse.data zoomIn: foldResponse.data
}); });
} else if (event.altKey) { } else if (event.altKey) {
@ -1707,14 +1707,14 @@ export class WYSIWYG {
app: protyle.app, app: protyle.app,
id: refBlockId, id: refBlockId,
position: "right", position: "right",
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
zoomIn: foldResponse.data zoomIn: foldResponse.data
}); });
} else if (ctrlIsPressed) { } else if (ctrlIsPressed) {
openFileById({ openFileById({
app: protyle.app, app: protyle.app,
id: refBlockId, id: refBlockId,
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
keepCursor: true, keepCursor: true,
zoomIn: foldResponse.data zoomIn: foldResponse.data
}); });
@ -1722,7 +1722,7 @@ export class WYSIWYG {
openFileById({ openFileById({
app: protyle.app, app: protyle.app,
id: refBlockId, id: refBlockId,
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
zoomIn: foldResponse.data zoomIn: foldResponse.data
}); });
} }

View file

@ -1641,7 +1641,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
openFileById({ openFileById({
app: protyle.app, app: protyle.app,
id, id,
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
zoomIn: foldResponse.data zoomIn: foldResponse.data
}); });
}); });
@ -1654,7 +1654,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
openFileById({ openFileById({
app: protyle.app, app: protyle.app,
id, id,
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
keepCursor: true, keepCursor: true,
zoomIn: foldResponse.data zoomIn: foldResponse.data
}); });
@ -1668,7 +1668,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
app: protyle.app, app: protyle.app,
id, id,
position: "right", position: "right",
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
zoomIn: foldResponse.data zoomIn: foldResponse.data
}); });
}); });
@ -1681,7 +1681,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
app: protyle.app, app: protyle.app,
id, id,
position: "bottom", position: "bottom",
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
zoomIn: foldResponse.data zoomIn: foldResponse.data
}); });
}); });

View file

@ -763,7 +763,8 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
openFileById({ openFileById({
app, app,
id, id,
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] :
(id === target.getAttribute("data-root-id") ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ROOTSCROLL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]),
zoomIn: foldResponse.data, zoomIn: foldResponse.data,
position: "right" position: "right"
}); });
@ -803,7 +804,8 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
openFileById({ openFileById({
app, app,
id, id,
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] :
(id === target.getAttribute("data-root-id") ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ROOTSCROLL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]),
zoomIn: foldResponse.data zoomIn: foldResponse.data
}); });
if (closeCB) { if (closeCB) {
@ -862,7 +864,8 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
app, app,
id, id,
position: "right", position: "right",
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] :
(id === target.getAttribute("data-root-id") ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ROOTSCROLL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]),
zoomIn: foldResponse.data zoomIn: foldResponse.data
}); });
if (closeCB) { if (closeCB) {
@ -891,7 +894,8 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
openFileById({ openFileById({
app, app,
id, id,
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] :
(id === target.getAttribute("data-root-id") ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ROOTSCROLL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]),
zoomIn: foldResponse.data zoomIn: foldResponse.data
}); });
if (closeCB) { if (closeCB) {