Profile page #30
|
@ -1,5 +1,3 @@
|
||||||
import { UserModel } from "./user.model";
|
|
||||||
|
|
||||||
export class PersonModel {
|
export class PersonModel {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
import { AfterViewInit, Component, ElementRef, ViewChild } from '@angular/core';
|
||||||
import { DomSanitizer, SafeStyle } from '@angular/platform-browser';
|
import { DomSanitizer, SafeStyle } from '@angular/platform-browser';
|
||||||
import { ActivatedRoute, ActivatedRouteSnapshot, ActivationStart, Data, Router, RoutesRecognized } from '@angular/router';
|
import { ActivatedRoute, Data, Router, RoutesRecognized } from '@angular/router';
|
||||||
import { PersonModel } from 'src/app/modules/auth/models/person.model';
|
import { PersonModel } from 'src/app/modules/auth/models/person.model';
|
||||||
import { AuthService } from 'src/app/modules/auth/services/auth/auth.service';
|
import { AuthService } from 'src/app/modules/auth/services/auth/auth.service';
|
||||||
import { ProfileTabEnum } from '../../enums/profile-tab.enum';
|
import { ProfileTabEnum } from '../../enums/profile-tab.enum';
|
||||||
|
@ -83,7 +83,7 @@ export class ProfileEditComponent implements AfterViewInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
loadPerson(personId: number) {
|
loadPerson(personId: number): void {
|
||||||
this.person = undefined;
|
this.person = undefined;
|
||||||
this.loaded = false;
|
this.loaded = false;
|
||||||
this.personService.get(personId).subscribe(person => {
|
this.personService.get(personId).subscribe(person => {
|
||||||
|
@ -92,7 +92,7 @@ export class ProfileEditComponent implements AfterViewInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
updateScroller() {
|
updateScroller(): void {
|
||||||
this.scrollHeader.nativeElement.style.height = '0px';
|
this.scrollHeader.nativeElement.style.height = '0px';
|
||||||
this.headerHeight = this.scrollHeader.nativeElement.scrollHeight;
|
this.headerHeight = this.scrollHeader.nativeElement.scrollHeight;
|
||||||
this.maxHeaderMove = this.scrollHeader.nativeElement.firstChild.scrollHeight;
|
this.maxHeaderMove = this.scrollHeader.nativeElement.firstChild.scrollHeight;
|
||||||
|
@ -106,7 +106,7 @@ export class ProfileEditComponent implements AfterViewInit {
|
||||||
}, 50);
|
}, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
activated(component) {
|
activated(component): void {
|
||||||
if (component.footerElement) {
|
if (component.footerElement) {
|
||||||
this.footerElement = component.footerElement;
|
this.footerElement = component.footerElement;
|
||||||
}
|
}
|
||||||
|
@ -118,14 +118,14 @@ export class ProfileEditComponent implements AfterViewInit {
|
||||||
}, 50);
|
}, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
deactivated(component) {
|
deactivated(component): void {
|
||||||
this.footerElement = undefined;
|
this.footerElement = undefined;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.updateScroller();
|
this.updateScroller();
|
||||||
}, 50);
|
}, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
onscrol(e) {
|
onscrol(e): void {
|
||||||
this.headerMove = Math.min(e.target.scrollTop, this.maxHeaderMove);
|
this.headerMove = Math.min(e.target.scrollTop, this.maxHeaderMove);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue