const html = require('choo/html'); const passwordInput = require('../passwordInput'); module.exports = function(state, emit) { const file = state.storage.getFileById(state.params.id); return html`
${passwordInput(file, state, emit)}
`; function togglePasswordInput(e) { const unlockInput = document.getElementById('password-input'); const boxChecked = e.target.checked; document .querySelector('form.passwordInput') .classList.toggle('passwordInput--hidden', !boxChecked); if (boxChecked) { unlockInput.focus(); } else { unlockInput.value = ''; } } };