clear password input on toggle off
This commit is contained in:
parent
a5d28adc44
commit
f814427a7d
|
@ -64,7 +64,9 @@ module.exports = function(state, emit) {
|
||||||
);
|
);
|
||||||
await delay(2000);
|
await delay(2000);
|
||||||
input.disabled = false;
|
input.disabled = false;
|
||||||
|
if (!copyBtn.parentNode.classList.contains('wait-password')) {
|
||||||
copyBtn.disabled = false;
|
copyBtn.disabled = false;
|
||||||
|
}
|
||||||
copyBtn.classList.remove('success');
|
copyBtn.classList.remove('success');
|
||||||
copyBtn.textContent = state.translate('copyUrlFormButton');
|
copyBtn.textContent = state.translate('copyUrlFormButton');
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,13 +22,17 @@ module.exports = function(state, emit) {
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
function togglePasswordInput(e) {
|
function togglePasswordInput(e) {
|
||||||
|
const unlockInput = document.getElementById('unlock-input');
|
||||||
|
const boxChecked = e.target.checked;
|
||||||
document.querySelector('.setPassword').classList.toggle('hidden');
|
document.querySelector('.setPassword').classList.toggle('hidden');
|
||||||
document
|
document
|
||||||
.getElementById('copy')
|
.getElementById('copy')
|
||||||
.classList.toggle('wait-password', e.target.checked);
|
.classList.toggle('wait-password', boxChecked);
|
||||||
document.getElementById('copy-btn').disabled = e.target.checked;
|
document.getElementById('copy-btn').disabled = boxChecked;
|
||||||
if (e.target.checked) {
|
if (boxChecked) {
|
||||||
document.getElementById('unlock-input').focus();
|
unlockInput.focus();
|
||||||
|
} else {
|
||||||
|
unlockInput.value = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue