From acb421a26be7819d5ee7d58bba047e04de04c087 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Sun, 30 Nov 2025 20:45:15 +0530 Subject: [PATCH] Tweak autocomp style and make auto-select behaviour configurable from the template. --- base.html | 2 +- static/main.js | 2 +- static/style.css | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/base.html b/base.html index b77d5fd..b857d09 100644 --- a/base.html +++ b/base.html @@ -58,7 +58,7 @@
+ type="text" id="q" name="q" value="{{ if .Data.Query }}{{ .Data.Query.Query }}{{ end }}" data-autocomp-autoselect="true" />
diff --git a/static/main.js b/static/main.js index f221821..30b6a35 100644 --- a/static/main.js +++ b/static/main.js @@ -273,7 +273,7 @@ async function screenshotElement(element) { let debounce; autocomp(elQ, { - autoSelect: false, + autoSelect: elQ.dataset.autocompAutoselect === "true", onQuery: async (val) => { const langCode = localStorage.from_lang; diff --git a/static/style.css b/static/style.css index 52c65a8..014f377 100644 --- a/static/style.css +++ b/static/style.css @@ -642,7 +642,7 @@ button:hover, /* Autocomplete */ .autocomp { - background: #f8f8f8; + background: #fff; border-radius: 0 0 5px 5px; border: 1px solid #ccc; border-top: 0; @@ -652,9 +652,9 @@ button:hover, } .autocomp-item { - padding-bottom: 5px; - padding: 10px; + padding: 5px 10px; cursor: pointer; + border-bottom: 1px solid #eee; } .autocomp-item:hover,