Vanessa 2024-05-29 11:17:20 +08:00
parent 72e79b05fb
commit d7407b74a5
4 changed files with 34 additions and 18 deletions

View file

@ -2072,9 +2072,11 @@ export class WYSIWYG {
} else if (aElement) {
refBlockId = aLink.substring(16, 38);
}
checkFold(refBlockId, (zoomIn, action) => {
checkFold(refBlockId, (zoomIn, action, isRoot) => {
// 块引用跳转后需要短暂高亮目标块 https://github.com/siyuan-note/siyuan/issues/11542
action.push(Constants.CB_GET_HL);
if (!isRoot) {
action.push(Constants.CB_GET_HL);
}
/// #if MOBILE
openMobileFileById(protyle.app, refBlockId, zoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
activeBlur();

View file

@ -638,7 +638,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
if (getSelectionPosition(nodeElement, range).top - protyle.wysiwyg.element.getBoundingClientRect().top < 40 || nodeElement.classList.contains("av")) {
if (protyle.title && protyle.title.editElement &&
(protyle.wysiwyg.element.firstElementChild.getAttribute("data-eof") === "1" ||
protyle.contentElement.scrollTop === 0)) {
protyle.contentElement.scrollTop === 0)) {
protyle.title.editElement.focus();
} else {
protyle.contentElement.scrollTop = 0;
@ -1525,8 +1525,10 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
if (refElement) {
const id = refElement.getAttribute("data-id");
if (matchHotKey(window.siyuan.config.keymap.editor.general.openBy.custom, event)) {
checkFold(id, (zoomIn, action) => {
action.push(Constants.CB_GET_HL);
checkFold(id, (zoomIn, action, isRoot) => {
if (!isRoot) {
action.push(Constants.CB_GET_HL);
}
openFileById({
app: protyle.app,
id,
@ -1552,8 +1554,10 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
event.stopPropagation();
return true;
} else if (matchHotKey(window.siyuan.config.keymap.editor.general.insertRight.custom, event)) {
checkFold(id, (zoomIn, action) => {
action.push(Constants.CB_GET_HL);
checkFold(id, (zoomIn, action, isRoot) => {
if (!isRoot) {
action.push(Constants.CB_GET_HL);
}
openFileById({
app: protyle.app,
id,
@ -1566,8 +1570,10 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
event.stopPropagation();
return true;
} else if (matchHotKey(window.siyuan.config.keymap.editor.general.insertBottom.custom, event)) {
checkFold(id, (zoomIn, action) => {
action.push(Constants.CB_GET_HL);
checkFold(id, (zoomIn, action, isRoot) => {
if (!isRoot) {
action.push(Constants.CB_GET_HL);
}
openFileById({
app: protyle.app,
id,