From 5f987a64d88e0c1bb0da8bde9050e3409879cbda Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Thu, 5 Nov 2020 16:32:15 +0100 Subject: Fix confirm popup before bookmark deletion Regression introduced by #1596 Fixes #1623 --- assets/default/js/base.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'assets') diff --git a/assets/default/js/base.js b/assets/default/js/base.js index 4163577d..66badfb2 100644 --- a/assets/default/js/base.js +++ b/assets/default/js/base.js @@ -294,7 +294,8 @@ function init(description) { const deleteLinks = document.querySelectorAll('.confirm-delete'); [...deleteLinks].forEach((deleteLink) => { deleteLink.addEventListener('click', (event) => { - if (!confirm(document.getElementById('translation-delete-tag').innerHTML)) { + const type = event.currentTarget.getAttribute('data-type') || 'link'; + if (!confirm(document.getElementById(`translation-delete-${type}`).innerHTML)) { event.preventDefault(); } }); -- cgit v1.2.3