#151 Fixed css style and show password

This commit is contained in:
mauriziovitale84
2016-06-08 17:28:55 +01:00
parent 43bf14b87d
commit 8228bcb090
5 changed files with 78 additions and 16 deletions

View File

@@ -40,6 +40,8 @@ export class AlfrescoLoginComponent {
__baseUrl = __moduleName.replace('/alfresco-login.component.js', '');
isPasswordShow: boolean = false;
@Output()
onSuccess = new EventEmitter();
@Output()
@@ -71,7 +73,7 @@ export class AlfrescoLoginComponent {
'password': ''
};
this.form = this._fb.group({
this.form = this._fb.group({
username: ['', Validators.compose([Validators.required, Validators.minLength(4)])],
password: ['', Validators.required]
});
@@ -149,6 +151,18 @@ export class AlfrescoLoginComponent {
}
}
/**
* Display and hide the password value.
*/
toggleShowPassword() {
this.isPasswordShow = !this.isPasswordShow;
if (this.isPasswordShow) {
(<HTMLInputElement>document.getElementById("password")).type = 'text'
} else {
(<HTMLInputElement>document.getElementById("password")).type = 'password';
}
}
/**
* The method return if a field is valid or not
* @param field