Commit a34155c2 authored by Almouhannad's avatar Almouhannad

(F) Add scolling behavoir when login

parent cf59987b
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<section id="doctors" class="doctors section"> <section id="doctors" class="doctors section">
<div class="container section-title"> <div class="container section-title">
<h2>الفريق الطبي</h2> <h2 style="margin-top: 1em;">الفريق الطبي</h2>
</div> </div>
<div class="container mt"> <div class="container mt">
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
</div> </div>
<div class="col-lg-6 content" data-aos="fade-up" data-aos-delay="100"> <div class="col-lg-6 content" data-aos="fade-up" data-aos-delay="100">
<h3 class="text-center">عن المستوصف</h3> <h3 class="text-center" style="margin-top:1em">عن المستوصف</h3>
<p class="text-center" style="font-weight: 600;"> <p class="text-center" style="font-weight: 600;">
يوفر مستوصف مركز الدراسات والبحوث العلمية الخدمات الطبية لموظفي المركز يوفر مستوصف مركز الدراسات والبحوث العلمية الخدمات الطبية لموظفي المركز
</p> </p>
......
...@@ -5,6 +5,7 @@ import { Router } from '@angular/router'; ...@@ -5,6 +5,7 @@ import { Router } from '@angular/router';
import { Roles } from '../../../../classes/authentication/roles'; import { Roles } from '../../../../classes/authentication/roles';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { ToastrService } from 'ngx-toastr'; import { ToastrService } from 'ngx-toastr';
import { ViewportScroller } from '@angular/common';
@Component({ @Component({
selector: 'app-header', selector: 'app-header',
...@@ -17,7 +18,9 @@ export class HeaderComponent { ...@@ -17,7 +18,9 @@ export class HeaderComponent {
constructor(private authenticationService: AuthenticationService, constructor(private authenticationService: AuthenticationService,
private router: Router, private router: Router,
private modalService: NgbModal, private modalService: NgbModal,
private toastrService: ToastrService) { } private toastrService: ToastrService,
private scroller: ViewportScroller
) { }
//#endregion //#endregion
//#region Inputs //#region Inputs
...@@ -51,6 +54,9 @@ export class HeaderComponent { ...@@ -51,6 +54,9 @@ export class HeaderComponent {
onLogin(userData: UserData) onLogin(userData: UserData)
{ {
this.userData = userData; this.userData = userData;
this.router.navigate(['']);
this.selectedButton = 'Home';
this.scroller.scrollToPosition([0,0]);
} }
//#endregion //#endregion
...@@ -62,7 +68,9 @@ export class HeaderComponent { ...@@ -62,7 +68,9 @@ export class HeaderComponent {
this.toastrService.success("تم تسجيل الخروج بنجاح ✔"); this.toastrService.success("تم تسجيل الخروج بنجاح ✔");
this.userData = null; this.userData = null;
this.showDropdown = false; this.showDropdown = false;
this.selectedButton = 'Home';
this.router.navigate(['']); this.router.navigate(['']);
this.scroller.scrollToPosition([0,0]);
} }
//#endregion //#endregion
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment