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) { 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 <button
id="resetButton" id="resetButton"
onclick=${toggleResetInput} onclick=${toggleResetInput}
@ -129,20 +140,6 @@ module.exports = function(state, emit) {
value="${state.translate('changePasswordButton')}"/> value="${state.translate('changePasswordButton')}"/>
</form> </form>
</div>`; </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) { function resetPassword(event) {

View file

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