Merge pull request #626 from ehuggett/623-password-field

Partial fix for #623
This commit is contained in:
Danny Coates 2017-11-02 11:02:58 -07:00 committed by GitHub
commit 360697c034
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,7 @@ module.exports = function(state, emit) {
const div = html` const div = html`
<div class="selectPassword"> <div class="selectPassword">
<div id="addPasswordWrapper"> <div id="addPasswordWrapper">
<input id="addPassword" type="checkbox" onchange=${togglePasswordInput}/> <input id="addPassword" type="checkbox" autocomplete="off" onchange=${togglePasswordInput}/>
<label for="addPassword"> <label for="addPassword">
${state.translate('requirePasswordCheckbox')}</label> ${state.translate('requirePasswordCheckbox')}</label>
</div> </div>
@ -24,7 +24,9 @@ module.exports = function(state, emit) {
function togglePasswordInput(e) { function togglePasswordInput(e) {
const unlockInput = document.getElementById('unlock-input'); const unlockInput = document.getElementById('unlock-input');
const boxChecked = e.target.checked; const boxChecked = e.target.checked;
document.querySelector('.setPassword').classList.toggle('hidden'); document
.querySelector('.setPassword')
.classList.toggle('hidden', !boxChecked);
document document
.getElementById('copy') .getElementById('copy')
.classList.toggle('wait-password', boxChecked); .classList.toggle('wait-password', boxChecked);