mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-15 00:21:00 +08:00
This commit is contained in:
parent
ff6220abaa
commit
a3094fe3ea
@ -160,10 +160,17 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
||||
if (getSelection().rangeCount > 0) {
|
||||
range = getSelection().getRangeAt(0);
|
||||
}
|
||||
const activePanelElement = document.querySelector(".layout__tab--active");
|
||||
let isFileFocus = false;
|
||||
if (activePanelElement && activePanelElement.classList.contains("sy__file")) {
|
||||
isFileFocus = true;
|
||||
}
|
||||
if (range) {
|
||||
window.siyuan.dialogs.find(item => {
|
||||
if (item.editor && item.editor.protyle.element.contains(range.startContainer)) {
|
||||
protyle = item.editor.protyle;
|
||||
// https://github.com/siyuan-note/siyuan/issues/9384
|
||||
isFileFocus = false;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@ -224,11 +231,6 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
const activePanelElement = document.querySelector(".layout__tab--active");
|
||||
let isFileFocus = false;
|
||||
if (activePanelElement && activePanelElement.classList.contains("sy__file")) {
|
||||
isFileFocus = true;
|
||||
}
|
||||
let searchKey = "";
|
||||
if (matchHotKey(window.siyuan.config.keymap.general.replace.custom, event)) {
|
||||
searchKey = window.siyuan.config.keymap.general.replace.custom;
|
||||
@ -254,7 +256,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
||||
return true;
|
||||
}
|
||||
if (!isFileFocus && matchHotKey(window.siyuan.config.keymap.editor.general.quickMakeCard.custom, event)) {
|
||||
if (protyle.title.editElement.contains(range.startContainer)) {
|
||||
if (protyle.title?.editElement.contains(range.startContainer)) {
|
||||
quickMakeCard(protyle, [protyle.title.element]);
|
||||
} else {
|
||||
const selectElement: Element[] = [];
|
||||
|
Loading…
Reference in New Issue
Block a user