mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-20 11:00:52 +08:00
This commit is contained in:
parent
24757b72c1
commit
3d1ff6ac16
@ -361,11 +361,8 @@ export const globalShortcut = () => {
|
|||||||
const currentType = currentLiElement.getAttribute("data-type") as TDockType;
|
const currentType = currentLiElement.getAttribute("data-type") as TDockType;
|
||||||
if (currentType) {
|
if (currentType) {
|
||||||
getDockByType(currentType).toggleModel(currentType, true);
|
getDockByType(currentType).toggleModel(currentType, true);
|
||||||
const target = event.target as HTMLElement;
|
if (document.activeElement) {
|
||||||
if (target.classList.contains("protyle-wysiwyg") ||
|
(document.activeElement as HTMLElement).blur();
|
||||||
target.classList.contains("protyle-title__input") ||
|
|
||||||
target.tagName === "INPUT" || target.tagName === "TEXTAREA") {
|
|
||||||
target.blur();
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const currentId = currentLiElement.getAttribute("data-id");
|
const currentId = currentLiElement.getAttribute("data-id");
|
||||||
@ -613,10 +610,8 @@ export const globalShortcut = () => {
|
|||||||
const matchDock = getAllDocks().find(item => {
|
const matchDock = getAllDocks().find(item => {
|
||||||
if (matchHotKey(window.siyuan.config.keymap.general[item.hotkeyLangId].custom, event)) {
|
if (matchHotKey(window.siyuan.config.keymap.general[item.hotkeyLangId].custom, event)) {
|
||||||
getDockByType(item.type).toggleModel(item.type);
|
getDockByType(item.type).toggleModel(item.type);
|
||||||
if (target.classList.contains("protyle-wysiwyg") ||
|
if (document.activeElement) {
|
||||||
target.classList.contains("protyle-title__input") ||
|
(document.activeElement as HTMLElement).blur();
|
||||||
target.tagName === "INPUT" || target.tagName === "TEXTAREA") {
|
|
||||||
target.blur();
|
|
||||||
}
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return true;
|
return true;
|
||||||
@ -627,23 +622,18 @@ export const globalShortcut = () => {
|
|||||||
}
|
}
|
||||||
if (matchHotKey(window.siyuan.config.keymap.general.riffCard.custom, event)) {
|
if (matchHotKey(window.siyuan.config.keymap.general.riffCard.custom, event)) {
|
||||||
openCard();
|
openCard();
|
||||||
if (target.classList.contains("protyle-wysiwyg") ||
|
if (document.activeElement) {
|
||||||
target.tagName === "TABLE" ||
|
(document.activeElement as HTMLElement).blur();
|
||||||
target.classList.contains("protyle-title__input") ||
|
|
||||||
target.tagName === "INPUT" || target.tagName === "TEXTAREA") {
|
|
||||||
target.blur();
|
|
||||||
}
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!isTabWindow && matchHotKey(window.siyuan.config.keymap.general.dailyNote.custom, event)) {
|
if (!isTabWindow && matchHotKey(window.siyuan.config.keymap.general.dailyNote.custom, event)) {
|
||||||
newDailyNote();
|
newDailyNote();
|
||||||
if (target.classList.contains("protyle-wysiwyg") ||
|
if (document.activeElement) {
|
||||||
target.tagName === "TABLE" ||
|
(document.activeElement as HTMLElement).blur();
|
||||||
target.classList.contains("protyle-title__input") ||
|
|
||||||
target.tagName === "INPUT" || target.tagName === "TEXTAREA") {
|
|
||||||
target.blur();
|
|
||||||
}
|
}
|
||||||
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user