1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Move search form to a dedicated page

This commit is contained in:
Frédéric Guillot 2024-03-01 16:12:17 -08:00
parent 1b5edfc00a
commit abdd5876a1
27 changed files with 148 additions and 199 deletions

View file

@ -121,19 +121,6 @@ function handleSubmitButtons() {
});
}
// Set cursor focus to the search input.
function setFocusToSearchInput(event) {
event.preventDefault();
event.stopPropagation();
const toggleSearchButton = document.querySelector(".search details")
if (!toggleSearchButton.getAttribute("open")) {
toggleSearchButton.setAttribute("open", "")
const searchInputElement = document.getElementById("search-input");
searchInputElement.focus();
searchInputElement.value = "";
}
}
// Show modal dialog with the list of keyboard shortcuts.
function showKeyboardShortcuts() {
let template = document.getElementById("keyboard-shortcuts");

View file

@ -35,7 +35,7 @@ document.addEventListener("DOMContentLoaded", () => {
keyboardHandler.on("?", () => showKeyboardShortcuts());
keyboardHandler.on("+", () => goToAddSubscription());
keyboardHandler.on("#", () => unsubscribeFromFeed());
keyboardHandler.on("/", (e) => setFocusToSearchInput(e));
keyboardHandler.on("/", () => goToPage("search"));
keyboardHandler.on("a", () => {
let enclosureElement = document.querySelector('.entry-enclosures');
if (enclosureElement) {

View file

@ -17,8 +17,7 @@ class KeyboardHandler {
return;
}
if (key != "Enter")
{
if (key != "Enter") {
event.preventDefault();
}