aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_modals/login-modal
diff options
context:
space:
mode:
authorNevena Bojovic <nenabojov@gmail.com>2022-04-04 21:52:26 +0200
committerNevena Bojovic <nenabojov@gmail.com>2022-04-04 21:52:26 +0200
commitcfaf42a42223bc60621ae583e8ac536d980a794a (patch)
treef43987731445ff7c0af42a2a1e014db905f37087 /frontend/src/app/_modals/login-modal
parent6ffac0e8f7803e895e411328917f6c49b2520b28 (diff)
parent8077f508fa552b789b669c433776357da1f809eb (diff)
Merge branch 'dev' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into dev
Diffstat (limited to 'frontend/src/app/_modals/login-modal')
-rw-r--r--frontend/src/app/_modals/login-modal/login-modal.component.html2
-rw-r--r--frontend/src/app/_modals/login-modal/login-modal.component.ts5
2 files changed, 5 insertions, 2 deletions
diff --git a/frontend/src/app/_modals/login-modal/login-modal.component.html b/frontend/src/app/_modals/login-modal/login-modal.component.html
index d7836848..03048155 100644
--- a/frontend/src/app/_modals/login-modal/login-modal.component.html
+++ b/frontend/src/app/_modals/login-modal/login-modal.component.html
@@ -3,7 +3,7 @@
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header" style="background-color: #003459;">
- <button id="closeButton" type="button" class="btn-close" style="background-color:white;" data-bs-dismiss="modal" aria-label="Close" (click)="resetData()"></button>
+ <button #closeButton type="button" class="btn-close" style="background-color:white;" data-bs-dismiss="modal" aria-label="Close" (click)="resetData()"></button>
</div>
<div class="modal-body px-5" style="color:#003459">
<h1 class="text-center mt-2 mb-4">Prijavite se</h1>
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 c86c269a..e1535a25 100644
--- a/frontend/src/app/_modals/login-modal/login-modal.component.ts
+++ b/frontend/src/app/_modals/login-modal/login-modal.component.ts
@@ -4,6 +4,7 @@ import { CookieService } from 'ngx-cookie-service';
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';
@Component({
selector: 'app-login-modal',
@@ -12,6 +13,8 @@ import shared from '../../Shared';
})
export class LoginModalComponent implements OnInit {
+ @ViewChild('closeButton') closeButton?: ElementRef;
+
username: string = '';
password: string = '';
@@ -38,7 +41,7 @@ export class LoginModalComponent implements OnInit {
}
else {
this.authService.authenticate(response);
- (<HTMLSelectElement>document.getElementById('closeButton')).click();
+ (<HTMLSelectElement>this.closeButton?.nativeElement).click();
this.userInfoService.getUserInfo().subscribe((response) => {
shared.photoId = response.photoId;
});