mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 11:13:46 +00:00
subtitle properties
This commit is contained in:
@@ -4,9 +4,7 @@ import { Identity } from '../domain/identity';
|
||||
|
||||
export class IdentityView implements View {
|
||||
title: string;
|
||||
firstName: string;
|
||||
middleName: string;
|
||||
lastName: string;
|
||||
address1: string;
|
||||
address2: string;
|
||||
address3: string;
|
||||
@@ -22,7 +20,46 @@ export class IdentityView implements View {
|
||||
passportNumber: string;
|
||||
licenseNumber: string;
|
||||
|
||||
// tslint:disable
|
||||
private _firstName: string;
|
||||
private _lastName: string;
|
||||
private _subTitle: string;
|
||||
// tslint:enable
|
||||
|
||||
constructor(i?: Identity) {
|
||||
// ctor
|
||||
}
|
||||
|
||||
get firstName(): string {
|
||||
return this._firstName;
|
||||
}
|
||||
set firstName(value: string) {
|
||||
this._firstName = value;
|
||||
this._subTitle = null;
|
||||
}
|
||||
|
||||
get lastName(): string {
|
||||
return this._lastName;
|
||||
}
|
||||
set lastName(value: string) {
|
||||
this._lastName = value;
|
||||
this._subTitle = null;
|
||||
}
|
||||
|
||||
get subTitle(): string {
|
||||
if (this._subTitle == null && (this.firstName != null || this.lastName != null)) {
|
||||
this._subTitle = '';
|
||||
if (this.firstName != null) {
|
||||
this._subTitle = this.firstName;
|
||||
}
|
||||
if (this.lastName != null) {
|
||||
if (this._subTitle !== '') {
|
||||
this._subTitle += ' ';
|
||||
}
|
||||
this._subTitle += this.lastName;
|
||||
}
|
||||
}
|
||||
|
||||
return this._subTitle;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user