mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-18 10:00:48 +08:00
This commit is contained in:
parent
40c56d1400
commit
5a22155e9f
@ -383,7 +383,15 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()
|
|||||||
if (event.key === "ArrowDown") {
|
if (event.key === "ArrowDown") {
|
||||||
currentList.classList.remove("b3-list-item--focus");
|
currentList.classList.remove("b3-list-item--focus");
|
||||||
if (!currentList.nextElementSibling) {
|
if (!currentList.nextElementSibling) {
|
||||||
searchPanelElement.children[0].classList.add("b3-list-item--focus");
|
if (config.group === 1) {
|
||||||
|
if (currentList.parentElement.nextElementSibling) {
|
||||||
|
currentList.parentElement.nextElementSibling.nextElementSibling.firstElementChild.classList.add("b3-list-item--focus");
|
||||||
|
} else {
|
||||||
|
searchPanelElement.children[1].firstElementChild.classList.add("b3-list-item--focus");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
searchPanelElement.firstElementChild.classList.add("b3-list-item--focus");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
currentList.nextElementSibling.classList.add("b3-list-item--focus");
|
currentList.nextElementSibling.classList.add("b3-list-item--focus");
|
||||||
}
|
}
|
||||||
@ -401,8 +409,15 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()
|
|||||||
} else if (event.key === "ArrowUp") {
|
} else if (event.key === "ArrowUp") {
|
||||||
currentList.classList.remove("b3-list-item--focus");
|
currentList.classList.remove("b3-list-item--focus");
|
||||||
if (!currentList.previousElementSibling) {
|
if (!currentList.previousElementSibling) {
|
||||||
const length = searchPanelElement.children.length;
|
if (config.group === 1) {
|
||||||
searchPanelElement.children[length - 1].classList.add("b3-list-item--focus");
|
if (currentList.parentElement.previousElementSibling.previousElementSibling) {
|
||||||
|
currentList.parentElement.previousElementSibling.previousElementSibling.lastElementChild.classList.add("b3-list-item--focus");
|
||||||
|
} else {
|
||||||
|
searchPanelElement.lastElementChild.lastElementChild.classList.add("b3-list-item--focus");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
searchPanelElement.lastElementChild.classList.add("b3-list-item--focus");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
currentList.previousElementSibling.classList.add("b3-list-item--focus");
|
currentList.previousElementSibling.classList.add("b3-list-item--focus");
|
||||||
}
|
}
|
||||||
@ -589,6 +604,7 @@ const inputEvent = (element: Element, config: ISearchOption, inputTimeout: numbe
|
|||||||
inputTimeout = window.setTimeout(() => {
|
inputTimeout = window.setTimeout(() => {
|
||||||
loadingElement.classList.remove("fn__none");
|
loadingElement.classList.remove("fn__none");
|
||||||
const inputValue = searchInputElement.value;
|
const inputValue = searchInputElement.value;
|
||||||
|
element.querySelector("#searchList").scrollTo(0, 0);
|
||||||
if (inputValue === "") {
|
if (inputValue === "") {
|
||||||
fetchPost("/api/block/getRecentUpdatedBlocks", {}, (response) => {
|
fetchPost("/api/block/getRecentUpdatedBlocks", {}, (response) => {
|
||||||
onSearch(response.data, edit, element);
|
onSearch(response.data, edit, element);
|
||||||
|
Loading…
Reference in New Issue
Block a user