1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 17:53:39 +00:00

shoe strength text in label

This commit is contained in:
Kyle Spearrin
2018-11-15 15:27:27 -05:00
parent 3eeba61280
commit 55dfb8df62
6 changed files with 30 additions and 19 deletions

View File

@@ -11,7 +11,13 @@
<div class="box-content-row" appBoxRow>
<div class="box-content-row-flex">
<div class="row-main">
<label for="masterPassword">{{'masterPass' | i18n}}</label>
<label for="masterPassword">
{{'masterPass' | i18n}}
<span class="sub-label text-{{masterPasswordScoreColor}}"
*ngIf="masterPasswordScoreText">
{{masterPasswordScoreText}}
</span>
</label>
<input id="masterPassword" type="{{showPassword ? 'text' : 'password'}}"
name="MasterPassword" class="monospaced" [(ngModel)]="masterPassword"
required [appAutofocus]="email !== ''" (input)="updatePasswordStrength()">

View File

@@ -23,21 +23,4 @@ export class RegisterComponent extends BaseRegisterComponent {
super(authService, router, i18nService, cryptoService, apiService, stateService, platformUtilsService,
passwordGenerationService);
}
get masterPasswordScoreWidth() {
return this.masterPasswordScore == null ? 0 : (this.masterPasswordScore + 1) * 20;
}
get masterPasswordScoreColor() {
switch (this.masterPasswordScore) {
case 4:
return 'success';
case 3:
return 'primary';
case 2:
return 'warning';
default:
return 'danger';
}
}
}