Fix dblclick: clear selection, select entry, render, open edit. closeEdit calls render. Trash FAB: moved from toolbar to floating button at bottom-left (like add FAB).

This commit is contained in:
2026-05-12 15:14:39 +01:00
parent d55be5f19e
commit 5836bd168d
5 changed files with 9 additions and 5 deletions
+2
View File
@@ -273,6 +273,8 @@ input:focus, select:focus { border-color:var(--accent); }
transition: 0.2s; z-index: 100; transition: 0.2s; z-index: 100;
} }
.fab:hover { transform: scale(1.1); filter: brightness(1.1); } .fab:hover { transform: scale(1.1); filter: brightness(1.1); }
.fab-trash { left: 2rem; right: auto; font-size:1.4rem; }
.fab-trash.active { background:var(--danger); }
/* Generic modal overlay (if you dont already have it) */ /* Generic modal overlay (if you dont already have it) */
.modal-overlay { .modal-overlay {
+2 -2
View File
@@ -54,8 +54,9 @@
</div> </div>
</div> </div>
<!-- Floating action button --> <!-- Floating action buttons -->
<button class="fab" onclick="openAdd()" title="Add password">+</button> <button class="fab" onclick="openAdd()" title="Add password">+</button>
<button class="fab fab-trash" id="trashBtn" onclick="toggleTrash()" title="Trash">🗑️</button>
<div class="vault"> <div class="vault">
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:0.6rem"> <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:0.6rem">
<h1 style="margin-bottom:0">🔐 Vault <span>XAMPP</span></h1> <h1 style="margin-bottom:0">🔐 Vault <span>XAMPP</span></h1>
@@ -154,7 +155,6 @@
<button type="button" class="clear-search-btn" id="clearSearchBtn" onclick="clearSearch()" title="Clear search"></button> <button type="button" class="clear-search-btn" id="clearSearchBtn" onclick="clearSearch()" title="Clear search"></button>
</div> </div>
<div style="display:flex;gap:.4rem;align-items:center;flex-wrap:wrap"> <div style="display:flex;gap:.4rem;align-items:center;flex-wrap:wrap">
<button class="btn btn-outline btn-sm" id="trashBtn" onclick="toggleTrash()" title="Trash">🗑️</button>
<button class="btn btn-outline btn-sm" onclick="showShortcutsHelp()" title="Shortcuts">⌨️</button> <button class="btn btn-outline btn-sm" onclick="showShortcutsHelp()" title="Shortcuts">⌨️</button>
<div class="view-dropdown" id="viewDropdown"> <div class="view-dropdown" id="viewDropdown">
<button class="btn btn-outline btn-sm" id="viewDropdownBtn">🟫 Grid ▾</button> <button class="btn btn-outline btn-sm" id="viewDropdownBtn">🟫 Grid ▾</button>
+4 -3
View File
@@ -291,7 +291,7 @@ function toggleTrash() {
showTrash = !showTrash; showTrash = !showTrash;
const btn = document.getElementById('trashBtn'); const btn = document.getElementById('trashBtn');
const actions = document.getElementById('trashActions'); const actions = document.getElementById('trashActions');
if (btn) { btn.textContent = showTrash ? '📋 Active' : '🗑️ Trash'; btn.classList.toggle('btn-danger', showTrash); } if (btn) { btn.textContent = showTrash ? '📋' : '🗑️'; btn.classList.toggle('active', showTrash); btn.title = showTrash ? 'Active entries' : 'Trash'; }
if (actions) actions.classList.toggle('hidden', !showTrash); if (actions) actions.classList.toggle('hidden', !showTrash);
loadEntries(); loadEntries();
playSound('click'); playSound('click');
@@ -1000,10 +1000,11 @@ function attachEvents() {
el.addEventListener('dblclick', function(ev) { el.addEventListener('dblclick', function(ev) {
const id = this.dataset.id; const id = this.dataset.id;
if (id && !showTrash) { if (id && !showTrash) {
ev.stopPropagation(); ev.preventDefault();
selectedIds.clear(); selectedIds.clear();
selectedIds.add(parseInt(id)); selectedIds.add(parseInt(id));
updateBatchBar(); updateBatchBar();
render();
openEdit(id); openEdit(id);
} }
}); });
@@ -1056,7 +1057,7 @@ function openEdit(id) {
document.getElementById('editSite').focus(); document.getElementById('editSite').focus();
playSound('open'); playSound('open');
} }
function closeEdit() { document.getElementById('editModal').classList.remove('show'); playSound('close'); } function closeEdit() { document.getElementById('editModal').classList.remove('show'); render(); playSound('close'); }
function toggleEditPassword() { const f = document.getElementById('editPassword'); f.type = f.type === 'password' ? 'text' : 'password'; } function toggleEditPassword() { const f = document.getElementById('editPassword'); f.type = f.type === 'password' ? 'text' : 'password'; }
async function saveEdit() { async function saveEdit() {
const id = document.getElementById('editId').value; const id = document.getElementById('editId').value;
+1
View File
@@ -0,0 +1 @@
[2026-05-09 15:27:22] FATAL: database is locked
BIN
View File
Binary file not shown.