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