Mask Card Code on Angular Web Vault (#6)

* Adding mask and toggle for Card Security Code

* For Card Code Mask - show same number of characters as code

* Mask Card Code in angular web vault
This commit is contained in:
Neil Burrows 2018-06-16 13:39:51 +01:00 committed by Kyle Spearrin
parent c3ad9b9b7d
commit 8fcbc887a2
1 changed files with 7 additions and 0 deletions

View File

@ -46,6 +46,7 @@ export class AddEditComponent {
deletePromise: Promise<any>; deletePromise: Promise<any>;
checkPasswordPromise: Promise<number>; checkPasswordPromise: Promise<number>;
showPassword: boolean = false; showPassword: boolean = false;
showCardCode: boolean = false;
cipherType = CipherType; cipherType = CipherType;
fieldType = FieldType; fieldType = FieldType;
addFieldType: FieldType = FieldType.Text; addFieldType: FieldType = FieldType.Text;
@ -262,6 +263,12 @@ export class AddEditComponent {
document.getElementById('loginPassword').focus(); document.getElementById('loginPassword').focus();
} }
toggleCardCode() {
this.analytics.eventTrack.next({ action: 'Toggled CardCode on Edit' });
this.showCardCode = !this.showCardCode;
document.getElementById('cardCode').focus();
}
toggleFieldValue(field: FieldView) { toggleFieldValue(field: FieldView) {
const f = (field as any); const f = (field as any);
f.showValue = !f.showValue; f.showValue = !f.showValue;