toggle password on unlock page
This commit is contained in:
parent
40e135a297
commit
8e519f5518
|
@ -4,10 +4,19 @@
|
||||||
<p>{{'yourVaultIsLocked' | i18n}}</p>
|
<p>{{'yourVaultIsLocked' | i18n}}</p>
|
||||||
<div class="box last">
|
<div class="box last">
|
||||||
<div class="box-content">
|
<div class="box-content">
|
||||||
<div class="box-content-row" appBoxRow>
|
<div class="box-content-row box-content-row-flex" appBoxRow>
|
||||||
<label for="masterPassword">{{'masterPass' | i18n}}</label>
|
<div class="row-main">
|
||||||
<input id="masterPassword" type="password" name="MasterPassword" [(ngModel)]="masterPassword"
|
<label for="masterPassword">{{'masterPass' | i18n}}</label>
|
||||||
required appAutofocus>
|
<input id="masterPassword" type="{{showPassword ? 'text' : 'password'}}" name="MasterPassword"
|
||||||
|
class="monospaced" [(ngModel)]="masterPassword" required appAutofocus>
|
||||||
|
</div>
|
||||||
|
<div class="action-buttons">
|
||||||
|
<a class="row-btn" href="#" appStopClick appBlurClick
|
||||||
|
title="{{'toggleVisibility' | i18n}}" (click)="togglePassword()">
|
||||||
|
<i class="fa fa-lg"
|
||||||
|
[ngClass]="{'fa-eye': !showPassword, 'fa-eye-slash': showPassword}"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -18,6 +18,7 @@ import { UserService } from 'jslib/abstractions/user.service';
|
||||||
})
|
})
|
||||||
export class LockComponent {
|
export class LockComponent {
|
||||||
masterPassword: string = '';
|
masterPassword: string = '';
|
||||||
|
showPassword: boolean = false;
|
||||||
|
|
||||||
constructor(private router: Router, private analytics: Angulartics2,
|
constructor(private router: Router, private analytics: Angulartics2,
|
||||||
private toasterService: ToasterService, private i18nService: I18nService,
|
private toasterService: ToasterService, private i18nService: I18nService,
|
||||||
|
@ -53,4 +54,10 @@ export class LockComponent {
|
||||||
this.messagingService.send('logout');
|
this.messagingService.send('logout');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
togglePassword() {
|
||||||
|
this.analytics.eventTrack.next({ action: 'Toggled Master Password on Unlock' });
|
||||||
|
this.showPassword = !this.showPassword;
|
||||||
|
document.getElementById('masterPassword').focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue