added password setting error UI

This commit is contained in:
Danny Coates 2018-02-21 12:35:52 -08:00
parent c18f488be7
commit 14b40d820b
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
9 changed files with 63 additions and 48 deletions

View file

@ -9,7 +9,7 @@ module.exports = function(state, emit) {
<div class="checkbox">
<input
${file.hasPassword ? 'disabled' : ''}
${file.hasPassword ? 'checked' : ''}
${file.hasPassword || state.passwordSetError ? 'checked' : ''}
class="checkbox__input"
id="add-password"
type="checkbox"
@ -26,7 +26,7 @@ module.exports = function(state, emit) {
const unlockInput = document.getElementById('password-input');
const boxChecked = e.target.checked;
document
.querySelector('form.passwordInput')
.querySelector('.passwordInput')
.classList.toggle('passwordInput--hidden', !boxChecked);
if (boxChecked) {
unlockInput.focus();