diff options
author | Alan Pearce | 2024-12-31 14:56:37 +0100 |
---|---|---|
committer | Alan Pearce | 2025-01-02 15:05:56 +0100 |
commit | 58643f38bdd62dc538a03865b1f81eb77d957779 (patch) | |
tree | bf2c5ccce1592ae8bc30508be38510f15fe31b5e /frontend | |
parent | 1872c47e393e9c4c811f3b90ec2e0ac4cd8767b2 (diff) | |
download | searchix-58643f38bdd62dc538a03865b1f81eb77d957779.tar.lz searchix-58643f38bdd62dc538a03865b1f81eb77d957779.tar.zst searchix-58643f38bdd62dc538a03865b1f81eb77d957779.zip |
feat: show scores in results table in dev mode
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/static/search.js | 11 | ||||
-rw-r--r-- | frontend/static/style.css | 5 |
2 files changed, 16 insertions, 0 deletions
diff --git a/frontend/static/search.js b/frontend/static/search.js index 760ca28..52fa2f4 100644 --- a/frontend/static/search.js +++ b/frontend/static/search.js @@ -28,10 +28,21 @@ if (window.trustedTypes && trustedTypes.createPolicy) { }); } +function openSiblingDialog(ev) { + const dialog = ev.target.nextElementSibling; + dialog.showModal(); + dialog.querySelector("button").addEventListener("click", function () { + dialog.close(); + }); +} + function addOpenDialogListeners(results) { results.querySelectorAll("a.open-dialog").forEach(function (element) { element.addEventListener("click", handleDialogOpen); }); + results.querySelectorAll("a.open-sibling-dialog").forEach(function (element) { + element.addEventListener("click", openSiblingDialog); + }); } function paginationLinkClicked(ev) { diff --git a/frontend/static/style.css b/frontend/static/style.css index 60b38c8..8766844 100644 --- a/frontend/static/style.css +++ b/frontend/static/style.css @@ -185,3 +185,8 @@ li { p:last-child { margin-bottom: unset; } + +.open-sibling-dialog { + cursor: pointer; + text-decoration: underline; +} |