mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 01:50:12 +01:00
This commit is contained in:
parent
f10c0bcd4d
commit
56eeedc20a
1 changed files with 4 additions and 3 deletions
|
|
@ -229,7 +229,7 @@ export const keymap = {
|
||||||
keymap.element.querySelectorAll("#keymapList .b3-list-item--hide-action > .b3-list-item__text").forEach(item => {
|
keymap.element.querySelectorAll("#keymapList .b3-list-item--hide-action > .b3-list-item__text").forEach(item => {
|
||||||
const liElement = item.parentElement;
|
const liElement = item.parentElement;
|
||||||
let matchedKeymap = false;
|
let matchedKeymap = false;
|
||||||
if (keymapString === "" || (liElement.querySelector(".b3-text-field") as HTMLInputElement).value.indexOf(updateHotkeyTip(keymapString)) > -1) {
|
if (keymapString === "" || liElement.querySelector(".b3-text-field").getAttribute("data-value").indexOf(keymapString) > -1) {
|
||||||
matchedKeymap = true;
|
matchedKeymap = true;
|
||||||
}
|
}
|
||||||
if ((item.textContent.toLowerCase().indexOf(value.toLowerCase()) > -1 || value.toLowerCase().indexOf(item.textContent.toLowerCase()) > -1 || value === "") && matchedKeymap) {
|
if ((item.textContent.toLowerCase().indexOf(value.toLowerCase()) > -1 || value.toLowerCase().indexOf(item.textContent.toLowerCase()) > -1 || value === "") && matchedKeymap) {
|
||||||
|
|
@ -298,13 +298,13 @@ export const keymap = {
|
||||||
const searchElement = keymap.element.querySelector("#keymapInput") as HTMLInputElement;
|
const searchElement = keymap.element.querySelector("#keymapInput") as HTMLInputElement;
|
||||||
const searchKeymapElement = keymap.element.querySelector("#searchByKey") as HTMLInputElement;
|
const searchKeymapElement = keymap.element.querySelector("#searchByKey") as HTMLInputElement;
|
||||||
searchElement.addEventListener("compositionend", () => {
|
searchElement.addEventListener("compositionend", () => {
|
||||||
keymap.search(searchElement.value, searchKeymapElement.value);
|
keymap.search(searchElement.value, searchKeymapElement.dataset.value);
|
||||||
});
|
});
|
||||||
searchElement.addEventListener("input", (event: InputEvent) => {
|
searchElement.addEventListener("input", (event: InputEvent) => {
|
||||||
if (event.isComposing) {
|
if (event.isComposing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
keymap.search(searchElement.value, searchKeymapElement.value);
|
keymap.search(searchElement.value, searchKeymapElement.dataset.value);
|
||||||
});
|
});
|
||||||
/// #if !BROWSER
|
/// #if !BROWSER
|
||||||
searchKeymapElement.addEventListener("focus", () => {
|
searchKeymapElement.addEventListener("focus", () => {
|
||||||
|
|
@ -325,6 +325,7 @@ export const keymap = {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.value = updateHotkeyTip(keymapStr);
|
this.value = updateHotkeyTip(keymapStr);
|
||||||
});
|
});
|
||||||
|
this.dataset.keymap = keymapStr;
|
||||||
keymap.search(searchElement.value, keymapStr);
|
keymap.search(searchElement.value, keymapStr);
|
||||||
});
|
});
|
||||||
keymap.element.querySelector("#clearSearchBtn").addEventListener("click", () => {
|
keymap.element.querySelector("#clearSearchBtn").addEventListener("click", () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue