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:
parent
1b5edfc00a
commit
abdd5876a1
27 changed files with 148 additions and 199 deletions
|
@ -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");
|
||||
|
|
2
internal/ui/static/js/bootstrap.js
vendored
2
internal/ui/static/js/bootstrap.js
vendored
|
@ -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) {
|
||||
|
|
|
@ -17,8 +17,7 @@ class KeyboardHandler {
|
|||
return;
|
||||
}
|
||||
|
||||
if (key != "Enter")
|
||||
{
|
||||
if (key != "Enter") {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue