a very slight refactor of previous commit

This commit is contained in:
Danny Coates 2018-01-19 17:14:14 -08:00
parent 48b21de011
commit 72279f4995
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
2 changed files with 13 additions and 16 deletions

View File

@ -106,7 +106,18 @@ module.exports = function(state, emit) {
`;
function passwordComplete(password) {
const el = html`<div class="selectPassword">
const passwordSpan = html([
`<span>${state.translate('passwordResult', {
password:
'<pre class="passwordOriginal"></pre><pre class="passwordMask"></pre>'
})}</span>`
]);
const og = passwordSpan.querySelector('.passwordOriginal');
const masked = passwordSpan.querySelector('.passwordMask');
og.textContent = password;
masked.textContent = password.replace(/./g, '●');
return html`<div class="selectPassword">
${passwordSpan}
<button
id="resetButton"
onclick=${toggleResetInput}
@ -129,20 +140,6 @@ module.exports = function(state, emit) {
value="${state.translate('changePasswordButton')}"/>
</form>
</div>`;
const passwordSpan = html([
`<span>${state.translate('passwordResult', {
password:
'<pre class="passwordOriginal"></pre><pre class="passwordStar"></pre>'
})}</span>`
]);
passwordSpan.querySelector('.passwordOriginal').textContent = password;
passwordSpan.querySelector('.passwordStar').textContent = password.replace(
/./g,
'●'
);
el.insertBefore(passwordSpan, el.firstElementChild);
return el;
}
function resetPassword(event) {

View File

@ -702,7 +702,7 @@ tbody {
display: inline;
}
.selectPassword :hover .passwordStar {
.selectPassword :hover .passwordMask {
display: none;
}