mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-12 18:24:21 +01:00
This commit is contained in:
parent
f7ff2efaf8
commit
96a618f4a3
2 changed files with 8 additions and 3 deletions
|
|
@ -283,9 +283,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
|||
return true;
|
||||
}
|
||||
const target = event.target as HTMLElement;
|
||||
if (target.tagName !== "TABLE" && (
|
||||
target.tagName === "INPUT" || target.tagName === "TEXTAREA" || hasClosestByAttribute(target, "contenteditable", null)
|
||||
)) {
|
||||
if (target.tagName !== "TABLE" && (target.tagName === "INPUT" || target.tagName === "TEXTAREA")) {
|
||||
return false;
|
||||
}
|
||||
if (matchHotKey(window.siyuan.config.keymap.editor.general.refresh.custom, event)) {
|
||||
|
|
@ -316,6 +314,9 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
|||
event.preventDefault();
|
||||
return true;
|
||||
}
|
||||
if (hasClosestByClassName(target, "protyle-title__input")) {
|
||||
return false;
|
||||
}
|
||||
// 没有光标时,无法撤销 https://ld246.com/article/1624021111567
|
||||
if (matchHotKey(window.siyuan.config.keymap.editor.general.undo.custom, event)) {
|
||||
protyle.undo.undo(protyle);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@ import {hasClosestByClassName} from "./hasClosest";
|
|||
import {preventScroll} from "../scroll/preventScroll";
|
||||
|
||||
export const reloadProtyle = (protyle: IProtyle, focus: boolean) => {
|
||||
if (!protyle.preview.element.classList.contains("fn__none")) {
|
||||
protyle.preview.render(protyle);
|
||||
return;
|
||||
}
|
||||
if (window.siyuan.config.editor.displayBookmarkIcon) {
|
||||
protyle.wysiwyg.element.classList.add("protyle-wysiwyg--attr");
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue