aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_modals/login-modal/login-modal.component.ts
diff options
context:
space:
mode:
authorSonja Galovic <galovicsonja@gmail.com>2022-04-28 14:22:49 +0200
committerSonja Galovic <galovicsonja@gmail.com>2022-04-28 14:22:49 +0200
commitadbd70386b4fa13c940eed643cd1b252b5243051 (patch)
treeda7f4484fc97aaba340d4125517ee25fc73018f2 /frontend/src/app/_modals/login-modal/login-modal.component.ts
parent98d3f4dedaabf62213b95dd8e7b67f9e8ab99006 (diff)
Redizajn login modala uradjen.
Diffstat (limited to 'frontend/src/app/_modals/login-modal/login-modal.component.ts')
-rw-r--r--frontend/src/app/_modals/login-modal/login-modal.component.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/frontend/src/app/_modals/login-modal/login-modal.component.ts b/frontend/src/app/_modals/login-modal/login-modal.component.ts
index b28d9799..f69e1cff 100644
--- a/frontend/src/app/_modals/login-modal/login-modal.component.ts
+++ b/frontend/src/app/_modals/login-modal/login-modal.component.ts
@@ -14,10 +14,13 @@ import {AfterViewInit, ElementRef} from '@angular/core';
export class LoginModalComponent implements OnInit {
@ViewChild('closeButton') closeButton?: ElementRef;
+ @ViewChild('pass') passwordInput!: ElementRef;
username: string = '';
password: string = '';
+ passwordShown: boolean = false;
+
wrongCreds: boolean = false;
constructor(
@@ -37,6 +40,8 @@ export class LoginModalComponent implements OnInit {
if (response == "Username doesn't exist" || response == "Wrong password") {
this.wrongCreds = true;
this.password = '';
+ this.passwordShown = false;
+ this.passwordInput.nativeElement.type = "password";
}
else {
this.authService.authenticate(response);
@@ -57,4 +62,13 @@ export class LoginModalComponent implements OnInit {
this.username = '';
this.password = '';
}
+
+ togglePasswordShown() {
+ this.passwordShown = !this.passwordShown;
+
+ if (this.passwordShown)
+ this.passwordInput.nativeElement.type = "text";
+ else
+ this.passwordInput.nativeElement.type = "password";
+ }
}