Keep searchi resident with a global search shortcut and tray
This commit is contained in:
1 parent
54de583430
commit
24e80edaf9
9 files changed
+152
-12
No files matched your search
@@ -1555,6 +1555,19 @@ document.addEventListener("keydown", (event) => {
|
||||
query.select();
|
||||
}
|
||||
if (event.key === "Escape") {
|
||||
if (isNativeDesktop()) {
|
||||
event.preventDefault();
|
||||
const popovers =
|
||||
document.querySelectorAll<HTMLDetailsElement>(".popover[open]");
|
||||
if (popovers.length) {
|
||||
popovers.forEach((popover) => {
|
||||
popover.open = false;
|
||||
});
|
||||
} else {
|
||||
void invoke("hide_search").catch(showError);
|
||||
}
|
||||
return;
|
||||
}
|
||||
clearMedia();
|
||||
document
|
||||
.querySelectorAll<HTMLDetailsElement>(".popover[open]")
|
||||
@@ -1618,6 +1631,11 @@ async function initializeSurface() {
|
||||
queueSemanticRefresh(0);
|
||||
}).catch(showError);
|
||||
if (isNativeDesktop()) {
|
||||
void listen("search-hidden", () => {
|
||||
element("media-preview")
|
||||
.querySelectorAll<HTMLMediaElement>("audio,video")
|
||||
.forEach((player) => player.pause());
|
||||
}).catch(showError);
|
||||
void listen("folder-indexing-changed", () => {
|
||||
void refreshDesktopStatus().catch(showError);
|
||||
queueSemanticRefresh(0);
|
||||
|
||||
Reference in new issue
Block a user