aboutsummaryrefslogtreecommitdiff
path: root/internal/ui/static/js
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <f@miniflux.net> 2024-03-01 16:12:17 -0800
committerGravatar Frédéric Guillot <f@miniflux.net> 2024-03-01 16:56:15 -0800
commitabdd5876a14e1971b5caac93f6735773e7ee388b (patch)
tree0c7fca43f80ab3b1da921b9250e62727faea6546 /internal/ui/static/js
parent1b5edfc00aa1f862c50665e9561df868d554a221 (diff)
downloadv2-abdd5876a14e1971b5caac93f6735773e7ee388b.tar.gz
v2-abdd5876a14e1971b5caac93f6735773e7ee388b.tar.zst
v2-abdd5876a14e1971b5caac93f6735773e7ee388b.zip
Move search form to a dedicated page
Diffstat (limited to 'internal/ui/static/js')
-rw-r--r--internal/ui/static/js/app.js13
-rw-r--r--internal/ui/static/js/bootstrap.js2
-rw-r--r--internal/ui/static/js/keyboard_handler.js3
3 files changed, 2 insertions, 16 deletions
diff --git a/internal/ui/static/js/app.js b/internal/ui/static/js/app.js
index 99145d49..599119a2 100644
--- a/internal/ui/static/js/app.js
+++ b/internal/ui/static/js/app.js
@@ -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");
diff --git a/internal/ui/static/js/bootstrap.js b/internal/ui/static/js/bootstrap.js
index cd11008e..fcc4d648 100644
--- a/internal/ui/static/js/bootstrap.js
+++ b/internal/ui/static/js/bootstrap.js
@@ -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) {
diff --git a/internal/ui/static/js/keyboard_handler.js b/internal/ui/static/js/keyboard_handler.js
index 3459db5d..55b72964 100644
--- a/internal/ui/static/js/keyboard_handler.js
+++ b/internal/ui/static/js/keyboard_handler.js
@@ -17,8 +17,7 @@ class KeyboardHandler {
return;
}
- if (key != "Enter")
- {
+ if (key != "Enter") {
event.preventDefault();
}