Merge pull request #686 from shikhar-scs/hidePassword
Hide password while Typing and after Entering: Fixes #670
This commit is contained in:
commit
7b96c46e39
@ -12,7 +12,23 @@ function passwordComplete(state, password) {
|
|||||||
password: '<pre></pre>'
|
password: '<pre></pre>'
|
||||||
})}</div>`
|
})}</div>`
|
||||||
]);
|
]);
|
||||||
el.lastElementChild.textContent = password;
|
const displayPassword = [];
|
||||||
|
for (let i = 0; i < password.length; i++) {
|
||||||
|
displayPassword[i] = '●';
|
||||||
|
}
|
||||||
|
|
||||||
|
const passwordOriginal = document.createElement('div');
|
||||||
|
passwordOriginal.className = 'passwordOriginal';
|
||||||
|
passwordOriginal.innerText = password;
|
||||||
|
|
||||||
|
const passwordStar = document.createElement('div');
|
||||||
|
passwordStar.className = 'passwordStar';
|
||||||
|
passwordStar.innerText = displayPassword
|
||||||
|
.toString()
|
||||||
|
.split(',')
|
||||||
|
.join('');
|
||||||
|
el.lastElementChild.appendChild(passwordOriginal);
|
||||||
|
el.lastElementChild.appendChild(passwordStar);
|
||||||
return el;
|
return el;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,9 +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" autocomplete="off" onchange=${
|
<input id="addPassword" type="checkbox" autocomplete="off" onchange=${togglePasswordInput}/>
|
||||||
togglePasswordInput
|
|
||||||
}/>
|
|
||||||
<label for="addPassword">
|
<label for="addPassword">
|
||||||
${state.translate('requirePasswordCheckbox')}</label>
|
${state.translate('requirePasswordCheckbox')}</label>
|
||||||
</div>
|
</div>
|
||||||
@ -17,6 +15,7 @@ module.exports = function(state, emit) {
|
|||||||
maxlength="64"
|
maxlength="64"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
placeholder="${state.translate('unlockInputPlaceholder')}"
|
placeholder="${state.translate('unlockInputPlaceholder')}"
|
||||||
|
type="password"
|
||||||
oninput=${inputChanged}/>
|
oninput=${inputChanged}/>
|
||||||
<input type="submit"
|
<input type="submit"
|
||||||
id="unlock-btn"
|
id="unlock-btn"
|
||||||
|
@ -666,6 +666,18 @@ tbody {
|
|||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.passwordOriginal {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selectPassword :hover .passwordOriginal {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selectPassword :hover .passwordStar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.setPassword {
|
.setPassword {
|
||||||
align-self: left;
|
align-self: left;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
Loading…
Reference in New Issue
Block a user