|
@@ -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,
|