diff options
Diffstat (limited to 'frontend/static/search.js')
-rw-r--r-- | frontend/static/search.js | 11 |
1 files changed, 11 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) { |