Enter key saves in add/edit modals from any field
Pressing Enter in addSite, addUsername, passwordInput calls addEntry(). Enter in editSite, editUsername, editPassword calls saveEdit().
This commit is contained in:
@@ -1376,7 +1376,7 @@ document.addEventListener('mouseup', function(e) {
|
||||
}
|
||||
}
|
||||
});
|
||||
document.addEventListener('keypress', e => { if (e.key === 'Enter') { if (document.getElementById('passwordInput') === document.activeElement) addEntry(); else if (document.getElementById('loginPassword') === document.activeElement) login(); else if (document.getElementById('regPassword') === document.activeElement) register(); } });
|
||||
document.addEventListener('keypress', e => { if (e.key === 'Enter') { const a = document.activeElement; const id = a && a.id; if (id === 'passwordInput' || id === 'addSite' || id === 'addUsername') addEntry(); else if (id === 'editPassword' || id === 'editSite' || id === 'editUsername') saveEdit(); else if (id === 'loginPassword') login(); else if (id === 'regPassword') register(); } });
|
||||
document.getElementById('genModal').addEventListener('click', e => { if (e.target === e.currentTarget) closeGen(); });
|
||||
document.getElementById('editModal').addEventListener('click', e => { if (e.target === e.currentTarget) closeEdit(); });
|
||||
// ==================== KEYBOARD SHORTCUTS ====================
|
||||
|
||||
Reference in New Issue
Block a user