mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
This commit is contained in:
parent
347a0473c3
commit
63f2d72673
5 changed files with 17 additions and 8 deletions
|
|
@ -99,12 +99,13 @@ export const searchKeydown = (app: App, event: KeyboardEvent) => {
|
||||||
if (searchType !== "asset") {
|
if (searchType !== "asset") {
|
||||||
if (matchHotKey(window.siyuan.config.keymap.editor.general.insertRight.custom, event)) {
|
if (matchHotKey(window.siyuan.config.keymap.editor.general.insertRight.custom, event)) {
|
||||||
const id = currentList.getAttribute("data-node-id");
|
const id = currentList.getAttribute("data-node-id");
|
||||||
checkFold(id, (zoomIn, action) => {
|
checkFold(id, (zoomIn) => {
|
||||||
openFileById({
|
openFileById({
|
||||||
app,
|
app,
|
||||||
id,
|
id,
|
||||||
position: "right",
|
position: "right",
|
||||||
action: [...action, Constants.CB_GET_HL],
|
action: zoomIn ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL, Constants.CB_GET_HL] :
|
||||||
|
[Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_HL],
|
||||||
zoomIn,
|
zoomIn,
|
||||||
scrollPosition: "center"
|
scrollPosition: "center"
|
||||||
});
|
});
|
||||||
|
|
@ -222,11 +223,12 @@ export const searchKeydown = (app: App, event: KeyboardEvent) => {
|
||||||
replace(element, config, edit, false);
|
replace(element, config, edit, false);
|
||||||
} else {
|
} else {
|
||||||
const id = currentList.getAttribute("data-node-id");
|
const id = currentList.getAttribute("data-node-id");
|
||||||
checkFold(id, (zoomIn, action) => {
|
checkFold(id, (zoomIn) => {
|
||||||
openFileById({
|
openFileById({
|
||||||
app,
|
app,
|
||||||
id,
|
id,
|
||||||
action: [...action, Constants.CB_GET_HL],
|
action: zoomIn ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL, Constants.CB_GET_HL] :
|
||||||
|
[Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_HL],
|
||||||
zoomIn,
|
zoomIn,
|
||||||
scrollPosition: "center"
|
scrollPosition: "center"
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -339,6 +339,7 @@ const getUnInitTab = (options: IOpenFileOptions) => {
|
||||||
} else {
|
} else {
|
||||||
initObj.action = options.action;
|
initObj.action = options.action;
|
||||||
}
|
}
|
||||||
|
initObj.scrollPosition = options.scrollPosition;
|
||||||
item.headElement.setAttribute("data-initdata", JSON.stringify(initObj));
|
item.headElement.setAttribute("data-initdata", JSON.stringify(initObj));
|
||||||
item.parent.switchTab(item.headElement);
|
item.parent.switchTab(item.headElement);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -750,6 +750,7 @@ export const newModelByInitData = (app: App, tab: Tab, json: any) => {
|
||||||
rootId: json.rootId,
|
rootId: json.rootId,
|
||||||
blockId: json.blockId,
|
blockId: json.blockId,
|
||||||
mode: json.mode,
|
mode: json.mode,
|
||||||
|
scrollPosition: json.scrollPosition,
|
||||||
action: typeof json.action === "string" ? (json.action ? [json.action, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS]) : json.action.concat(Constants.CB_GET_FOCUS),
|
action: typeof json.action === "string" ? (json.action ? [json.action, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS]) : json.action.concat(Constants.CB_GET_FOCUS),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -464,6 +464,9 @@ const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScr
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (!focusElement && protyle.block.id === protyle.block.rootID) {
|
||||||
|
focusElement = protyle.title.editElement;
|
||||||
|
}
|
||||||
if (protyle.block.mode === 4) {
|
if (protyle.block.mode === 4) {
|
||||||
preventScroll(protyle);
|
preventScroll(protyle);
|
||||||
focusElement = protyle.wysiwyg.element.lastElementChild;
|
focusElement = protyle.wysiwyg.element.lastElementChild;
|
||||||
|
|
|
||||||
|
|
@ -815,11 +815,12 @@ export const genSearch = (app: App, config: Config.IUILayoutTabSearchConfig, ele
|
||||||
} else {
|
} else {
|
||||||
if (event.altKey) {
|
if (event.altKey) {
|
||||||
const id = target.getAttribute("data-node-id");
|
const id = target.getAttribute("data-node-id");
|
||||||
checkFold(id, (zoomIn, action) => {
|
checkFold(id, (zoomIn) => {
|
||||||
openFileById({
|
openFileById({
|
||||||
app,
|
app,
|
||||||
id,
|
id,
|
||||||
action: [...action, Constants.CB_GET_HL],
|
action: zoomIn ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL, Constants.CB_GET_HL] :
|
||||||
|
[Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_HL],
|
||||||
zoomIn,
|
zoomIn,
|
||||||
position: "right",
|
position: "right",
|
||||||
scrollPosition: "center"
|
scrollPosition: "center"
|
||||||
|
|
@ -856,11 +857,12 @@ export const genSearch = (app: App, config: Config.IUILayoutTabSearchConfig, ele
|
||||||
/// #endif
|
/// #endif
|
||||||
} else {
|
} else {
|
||||||
const id = target.getAttribute("data-node-id");
|
const id = target.getAttribute("data-node-id");
|
||||||
checkFold(id, (zoomIn, action) => {
|
checkFold(id, (zoomIn) => {
|
||||||
openFileById({
|
openFileById({
|
||||||
app,
|
app,
|
||||||
id,
|
id,
|
||||||
action: [...action, Constants.CB_GET_HL],
|
action: zoomIn ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL, Constants.CB_GET_HL] :
|
||||||
|
[Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_HL],
|
||||||
zoomIn,
|
zoomIn,
|
||||||
scrollPosition: "center"
|
scrollPosition: "center"
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue