From 72279f49951b51827de5b361235ff71a80e562ac Mon Sep 17 00:00:00 2001 From: Danny Coates Date: Fri, 19 Jan 2018 17:14:14 -0800 Subject: [PATCH] a very slight refactor of previous commit --- app/templates/share.js | 27 ++++++++++++--------------- assets/main.css | 2 +- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/app/templates/share.js b/app/templates/share.js index d785d109..2aa31230 100644 --- a/app/templates/share.js +++ b/app/templates/share.js @@ -106,7 +106,18 @@ module.exports = function(state, emit) { `; function passwordComplete(password) { - const el = html`
+ const passwordSpan = html([ + `${state.translate('passwordResult', { + password: + '
'
+      })}
` + ]); + const og = passwordSpan.querySelector('.passwordOriginal'); + const masked = passwordSpan.querySelector('.passwordMask'); + og.textContent = password; + masked.textContent = password.replace(/./g, '●'); + return html`
+ ${passwordSpan}
`; - - const passwordSpan = html([ - `${state.translate('passwordResult', { - password: - '
'
-      })}
` - ]); - passwordSpan.querySelector('.passwordOriginal').textContent = password; - passwordSpan.querySelector('.passwordStar').textContent = password.replace( - /./g, - '●' - ); - el.insertBefore(passwordSpan, el.firstElementChild); - return el; } function resetPassword(event) { diff --git a/assets/main.css b/assets/main.css index 464203bc..65d8bea1 100644 --- a/assets/main.css +++ b/assets/main.css @@ -702,7 +702,7 @@ tbody { display: inline; } -.selectPassword :hover .passwordStar { +.selectPassword :hover .passwordMask { display: none; }