mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
This commit is contained in:
parent
58d1978eb8
commit
72f28947d2
18 changed files with 80 additions and 76 deletions
|
|
@ -156,7 +156,7 @@ export class BlockPanel {
|
|||
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_CONTEXT);
|
||||
action.push(Constants.CB_GET_HL);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ export const initWindow = (app: App) => {
|
|||
openFileById({
|
||||
app,
|
||||
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,
|
||||
});
|
||||
ipcRenderer.send(Constants.SIYUAN_SHOW, getCurrentWindow().id);
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ export abstract class Constants {
|
|||
public static readonly CB_GET_UNUNDO = "cb-get-unundo"; // 不需要记录历史
|
||||
public static readonly CB_GET_SCROLL = "cb-get-scroll"; // 滚动到指定位置
|
||||
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_HISTORY = "cb-get-history"; // 历史渲染
|
||||
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ window.openFileByURL = (openURL) => {
|
|||
openFileById({
|
||||
app: siyuanApp,
|
||||
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
|
||||
});
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -474,7 +474,7 @@ export class Wnd {
|
|||
openFileById({
|
||||
app: this.app,
|
||||
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");
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ export class Bookmark extends Model {
|
|||
openFileById({
|
||||
app,
|
||||
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
|
||||
});
|
||||
});
|
||||
|
|
@ -103,7 +103,7 @@ export class Bookmark extends Model {
|
|||
app,
|
||||
id: element.getAttribute("data-node-id"),
|
||||
keepCursor: true,
|
||||
action: [Constants.CB_GET_CONTEXT]
|
||||
action: [Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]
|
||||
});
|
||||
},
|
||||
altClick(element: HTMLElement) {
|
||||
|
|
@ -111,7 +111,7 @@ export class Bookmark extends Model {
|
|||
app,
|
||||
id: element.getAttribute("data-node-id"),
|
||||
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) {
|
||||
|
|
@ -119,7 +119,7 @@ export class Bookmark extends Model {
|
|||
app,
|
||||
id: element.getAttribute("data-node-id"),
|
||||
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>',
|
||||
|
|
|
|||
|
|
@ -653,14 +653,14 @@ export class Graph extends Model {
|
|||
app: this.app,
|
||||
id: node.id,
|
||||
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) {
|
||||
openFileById({
|
||||
app: this.app,
|
||||
id: node.id,
|
||||
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) {
|
||||
window.siyuan.blockPanels.push(new BlockPanel({
|
||||
|
|
@ -674,7 +674,7 @@ export class Graph extends Model {
|
|||
openFileById({
|
||||
app: this.app,
|
||||
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]
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ export const JSONToLayout = (app: App, isStart: boolean) => {
|
|||
openFileById({
|
||||
app,
|
||||
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
|
||||
});
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
|
|||
openFileById({
|
||||
app: protyle.app,
|
||||
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
|
||||
});
|
||||
});
|
||||
|
|
@ -207,7 +207,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
|
|||
openFileById({
|
||||
app: protyle.app,
|
||||
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,
|
||||
zoomIn: foldResponse.data
|
||||
});
|
||||
|
|
@ -224,7 +224,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
|
|||
app: protyle.app,
|
||||
id: refBlockId,
|
||||
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
|
||||
});
|
||||
});
|
||||
|
|
@ -240,7 +240,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
|
|||
app: protyle.app,
|
||||
id: refBlockId,
|
||||
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
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export class MobileBookmarks {
|
|||
}
|
||||
}
|
||||
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>',
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ window.hideKeyboardToolbar = hideKeyboardToolbar;
|
|||
window.openFileByURL = (openURL) => {
|
||||
if (openURL && isSYProtocol(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 false;
|
||||
|
|
|
|||
|
|
@ -560,7 +560,7 @@ const initSearchEvent = (app: App, element: Element, config: ISearchOption) => {
|
|||
preventScroll(window.siyuan.mobile.editor.protyle);
|
||||
}
|
||||
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();
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ export const initFramework = (app: App) => {
|
|||
const idZoomIn = getIdZoomInByPath();
|
||||
if (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;
|
||||
}
|
||||
const localDoc = window.siyuan.storage[Constants.LOCAL_DOCINFO];
|
||||
|
|
@ -129,7 +129,7 @@ export const initFramework = (app: App) => {
|
|||
} else {
|
||||
fetchPost("/api/block/getRecentUpdatedBlocks", {}, (response) => {
|
||||
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 {
|
||||
setEmpty(app);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,50 +216,48 @@ export class Protyle {
|
|||
removeLoading(this.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;
|
||||
if (options.scrollAttr) {
|
||||
getDocByScroll({
|
||||
protyle: this.protyle,
|
||||
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", {
|
||||
id: options.blockId
|
||||
}, (response) => {
|
||||
if (!mergedOptions.action.includes(Constants.CB_GET_SCROLL) &&
|
||||
response.data.rootID !== options.blockId && mergedOptions.action.includes(Constants.CB_GET_ROOTSCROLL)) {
|
||||
// 打开根文档保持上一次历史,否则按照原有 action 执行 https://github.com/siyuan-note/siyuan/issues/9082
|
||||
this.getDoc(mergedOptions);
|
||||
return;
|
||||
}
|
||||
let scrollObj;
|
||||
if (response.data.ial.scroll) {
|
||||
try {
|
||||
scrollObj = JSON.parse(response.data.ial.scroll.replace(/"/g, '"'));
|
||||
} catch (e) {
|
||||
scrollObj = undefined;
|
||||
}
|
||||
let scrollObj;
|
||||
if (response.data.ial.scroll) {
|
||||
try {
|
||||
scrollObj = JSON.parse(response.data.ial.scroll.replace(/"/g, '"'));
|
||||
} catch (e) {
|
||||
scrollObj = undefined;
|
||||
}
|
||||
if (scrollObj) {
|
||||
scrollObj.rootId = response.data.rootID;
|
||||
getDocByScroll({
|
||||
protyle: this.protyle,
|
||||
scrollAttr: scrollObj,
|
||||
mergedOptions,
|
||||
cb: () => {
|
||||
this.afterOnGet(mergedOptions);
|
||||
}
|
||||
}
|
||||
if (scrollObj) {
|
||||
scrollObj.rootId = response.data.rootID;
|
||||
getDocByScroll({
|
||||
protyle: this.protyle,
|
||||
scrollAttr: scrollObj,
|
||||
mergedOptions,
|
||||
cb: () => {
|
||||
this.afterOnGet(mergedOptions);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.getDoc(mergedOptions);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
getDocByScroll({
|
||||
protyle: this.protyle,
|
||||
scrollAttr: options.scrollAttr,
|
||||
mergedOptions,
|
||||
cb: () => {
|
||||
this.afterOnGet(mergedOptions);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.getDoc(mergedOptions);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.getDoc(mergedOptions);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -259,6 +259,7 @@ const setHTML = (options: {
|
|||
}
|
||||
// 屏幕太高的页签 https://github.com/siyuan-note/siyuan/issues/5018
|
||||
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.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
|
||||
|
|
|
|||
|
|
@ -1699,7 +1699,7 @@ export class WYSIWYG {
|
|||
app: protyle.app,
|
||||
id: refBlockId,
|
||||
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
|
||||
});
|
||||
} else if (event.altKey) {
|
||||
|
|
@ -1707,14 +1707,14 @@ export class WYSIWYG {
|
|||
app: protyle.app,
|
||||
id: refBlockId,
|
||||
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
|
||||
});
|
||||
} else if (ctrlIsPressed) {
|
||||
openFileById({
|
||||
app: protyle.app,
|
||||
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,
|
||||
zoomIn: foldResponse.data
|
||||
});
|
||||
|
|
@ -1722,7 +1722,7 @@ export class WYSIWYG {
|
|||
openFileById({
|
||||
app: protyle.app,
|
||||
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
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1641,7 +1641,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
openFileById({
|
||||
app: protyle.app,
|
||||
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
|
||||
});
|
||||
});
|
||||
|
|
@ -1654,7 +1654,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
openFileById({
|
||||
app: protyle.app,
|
||||
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,
|
||||
zoomIn: foldResponse.data
|
||||
});
|
||||
|
|
@ -1668,7 +1668,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
app: protyle.app,
|
||||
id,
|
||||
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
|
||||
});
|
||||
});
|
||||
|
|
@ -1681,7 +1681,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
app: protyle.app,
|
||||
id,
|
||||
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
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -739,7 +739,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
|
|||
let isClick = event.detail === 1
|
||||
let isDblClick = event.detail === 2
|
||||
/// #if BROWSER
|
||||
const newDate = new Date().getTime()
|
||||
const newDate = new Date().getTime()
|
||||
isClick = newDate - lastClickTime > Constants.TIMEOUT_DBLCLICK
|
||||
isDblClick = !isClick;
|
||||
lastClickTime = newDate;
|
||||
|
|
@ -763,7 +763,8 @@ 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_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,
|
||||
position: "right"
|
||||
});
|
||||
|
|
@ -803,7 +804,8 @@ 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_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
|
||||
});
|
||||
if (closeCB) {
|
||||
|
|
@ -862,7 +864,8 @@ 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_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
|
||||
});
|
||||
if (closeCB) {
|
||||
|
|
@ -891,7 +894,8 @@ 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_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
|
||||
});
|
||||
if (closeCB) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue