aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_modals/login-modal/login-modal.component.ts
diff options
context:
space:
mode:
authorTAMARA JERINIC <tamara.jerinic@gmail.com>2022-05-10 21:22:12 +0200
committerTAMARA JERINIC <tamara.jerinic@gmail.com>2022-05-10 21:22:12 +0200
commit5bd53a2462836bf487835b2c326cb7785f0b1f56 (patch)
tree8aa1fd13120991f6dc8d2cc2e6f8568e4db6766f /frontend/src/app/_modals/login-modal/login-modal.component.ts
parent1bbc4ed9e3783b2363c71048c415b84803c26b6b (diff)
parent49fe1624676ccf1faec6454934d636e656194c4f (diff)
Merge branch 'redesign' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into redesign
# Conflicts: # frontend/src/app/_elements/form-model/form-model.component.ts
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.ts13
1 files changed, 11 insertions, 2 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 ccd78509..33c17c31 100644
--- a/frontend/src/app/_modals/login-modal/login-modal.component.ts
+++ b/frontend/src/app/_modals/login-modal/login-modal.component.ts
@@ -5,15 +5,17 @@ import { AuthService } from 'src/app/_services/auth.service';
import { UserInfoService } from 'src/app/_services/user-info.service';
import shared from '../../Shared';
import {AfterViewInit, ElementRef} from '@angular/core';
+import { MatSelect } from '@angular/material/select';
@Component({
selector: 'app-login-modal',
templateUrl: './login-modal.component.html',
styleUrls: ['./login-modal.component.css']
})
-export class LoginModalComponent implements OnInit {
+export class LoginModalComponent implements AfterViewInit {
@ViewChild('closeButton') closeButton?: ElementRef;
+ @ViewChild('usernameInput') usernameInput!: ElementRef;
@ViewChild('pass') passwordInput!: ElementRef;
username: string = '';
@@ -30,7 +32,14 @@ export class LoginModalComponent implements OnInit {
private userInfoService: UserInfoService
) { }
- ngOnInit(): void {
+ ngAfterViewInit(): void {
+ //console.log(this.usernameInput);
+ this.usernameInput.nativeElement.focus();
+ }
+
+ doLoginWithEnterKey(keyboardEvent: KeyboardEvent) {
+ if (keyboardEvent.code == "Enter" || keyboardEvent.code == "NumpadEnter")
+ this.doLogin();
}
doLogin() {