From 58643f38bdd62dc538a03865b1f81eb77d957779 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 31 Dec 2024 14:56:37 +0100 Subject: feat: show scores in results table in dev mode --- frontend/static/search.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'frontend/static/search.js') 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) { -- cgit 1.4.1