Add double-click on entry to open edit modal

Double-click any entry card/row (all views incl. detail) opens the edit modal. Excluded from trash view.
This commit is contained in:
2026-05-09 21:08:51 +01:00
parent 70c22ce153
commit f00bb2cdeb
+8 -2
View File
@@ -846,7 +846,7 @@ function detailC(list) {
html += '<span class="detail-counter">' + (detailIndex + 1) + ' of ' + list.length + '</span>'; html += '<span class="detail-counter">' + (detailIndex + 1) + ' of ' + list.length + '</span>';
html += '<button onclick="goDetail(1)"' + (hasNext ? '' : ' disabled') + '>Next ▶</button>'; html += '<button onclick="goDetail(1)"' + (hasNext ? '' : ' disabled') + '>Next ▶</button>';
html += '</div>'; html += '</div>';
html += '<div class="detail-card' + (e.favorite ? ' favorite' : '') + '">'; html += '<div class="detail-card' + (e.favorite ? ' favorite' : '') + '" data-id="' + e.id + '">';
html += '<div class="detail-field"><span class="detail-label">Site</span><span class="detail-value">🌐 ' + highlightText(e.site, searchQuery) + '</span></div>'; html += '<div class="detail-field"><span class="detail-label">Site</span><span class="detail-value">🌐 ' + highlightText(e.site, searchQuery) + '</span></div>';
if (showMail) html += '<div class="detail-field"><span class="detail-label">Username</span><span class="detail-value">👤 ' + highlightText(e.username, searchQuery) + '</span></div>'; if (showMail) html += '<div class="detail-field"><span class="detail-label">Username</span><span class="detail-value">👤 ' + highlightText(e.username, searchQuery) + '</span></div>';
if (!showTrash) { if (!showTrash) {
@@ -984,7 +984,13 @@ function attachEvents() {
document.querySelectorAll('.edit-btn').forEach(b => b.onclick = function(ev) { ev.stopPropagation(); openEdit(this.dataset.id); }); document.querySelectorAll('.edit-btn').forEach(b => b.onclick = function(ev) { ev.stopPropagation(); openEdit(this.dataset.id); });
document.querySelectorAll('.star-btn').forEach(b => b.onclick = function(ev) { ev.stopPropagation(); toggleFavorite(this.dataset.id); }); document.querySelectorAll('.star-btn').forEach(b => b.onclick = function(ev) { ev.stopPropagation(); toggleFavorite(this.dataset.id); });
document.querySelectorAll('.copy-p').forEach(b => b.onclick = async function(ev) { ev.stopPropagation(); const pw = entryPw(this.dataset.id); try { await navigator.clipboard.writeText(pw); this.textContent = '✓'; const btn = this; setTimeout(() => { btn.textContent = '📋'; }, 1000); showZigzagToast(this, '📋 Copied!', 'success'); playSound('copy'); } catch (e) { showZigzagToast(this, 'Failed', 'error'); } }); document.querySelectorAll('.copy-p').forEach(b => b.onclick = async function(ev) { ev.stopPropagation(); const pw = entryPw(this.dataset.id); try { await navigator.clipboard.writeText(pw); this.textContent = '✓'; const btn = this; setTimeout(() => { btn.textContent = '📋'; }, 1000); showZigzagToast(this, '📋 Copied!', 'success'); playSound('copy'); } catch (e) { showZigzagToast(this, 'Failed', 'error'); } });
// Password reveal on hover // Double-click entry to edit
document.querySelectorAll('[draggable="true"], .detail-card').forEach(el => {
el.addEventListener('dblclick', function(ev) {
const id = this.dataset.id;
if (id && !showTrash) { ev.stopPropagation(); openEdit(id); }
});
});
if (showView) { if (showView) {
document.querySelectorAll('.pw-display.pw-hover').forEach(el => { document.querySelectorAll('.pw-display.pw-hover').forEach(el => {
el.addEventListener('mouseenter', function() { el.addEventListener('mouseenter', function() {