From 968e46d3db8346dcbbaa23e4793707d4357d5357 Mon Sep 17 00:00:00 2001 From: relikd Date: Mon, 22 Jul 2024 20:31:56 +0200 Subject: [PATCH] fix: unselect pin on click --- frontend/script.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/script.js b/frontend/script.js index 0fc53e1..1415b63 100644 --- a/frontend/script.js +++ b/frontend/script.js @@ -86,7 +86,11 @@ function selectPin(e) { } function unselectPin(e) { - document.getElementById('pin-' + e.target.dataset.pk) + unselectPinById(e.target.dataset.pk); +} + +function unselectPinById(pid) { + document.getElementById('pin-' + pid) .parentNode.classList.remove('selected'); } @@ -303,6 +307,7 @@ async function start() { function onHashChange() { if (location.hash.length > 1) { const [id, pw] = location.hash.slice(1).split(':', 1); + unselectPinById(id); openDetails(id, pw); } else { clearDetails();