mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 15:28:49 +01:00
This commit is contained in:
parent
3a1b55b1c3
commit
3dcbaf4c37
1 changed files with 4 additions and 4 deletions
|
|
@ -53,10 +53,6 @@ export const searchKeydown = (app: App, event: KeyboardEvent) => {
|
|||
const assetsElement = element.querySelector("#searchAssets");
|
||||
const isAsset = !assetsElement.classList.contains("fn__none");
|
||||
const listElement = isAsset ? assetsElement.querySelector("#searchAssetList") : element.querySelector("#searchList");
|
||||
let currentList: HTMLElement = listElement.querySelector(".b3-list-item--focus");
|
||||
if (!currentList) {
|
||||
return false;
|
||||
}
|
||||
const searchInputElement = element.querySelector("#searchInput") as HTMLInputElement;
|
||||
if (!isAsset && matchHotKey(window.siyuan.config.keymap.general.newFile.custom, event)) {
|
||||
newFileByName(app, searchInputElement.value);
|
||||
|
|
@ -80,6 +76,10 @@ export const searchKeydown = (app: App, event: KeyboardEvent) => {
|
|||
// 不能返回 true,否则历史菜单无法使用快捷键
|
||||
return false;
|
||||
}
|
||||
let currentList: HTMLElement = listElement.querySelector(".b3-list-item--focus");
|
||||
if (!currentList) {
|
||||
return false;
|
||||
}
|
||||
if (currentList.getAttribute("data-type") === "search-new") {
|
||||
if (event.key === "Enter") {
|
||||
newFileByName(app, searchInputElement.value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue