Commits

noltrifork authored c0504997534
DGAF-2308, Valg af skabelon skal gøres inaktiv, når der redigeres i allerede gemte aftaledata
No tags

src/app/activities/activities.component.ts

Modified
80 80 this.scrollToActivities();
81 81 }
82 82 });
83 83 }
84 84
85 85 public scrollToActivities = () => {
86 86 const subscriber = this.activitiesService.futureActivities$.subscribe((activities: Activity[]) => {
87 87 if (activities?.length > 0) {
88 88 setTimeout(() => {
89 89 const elementYPos = this.upcomingActivities?.nativeElement.getBoundingClientRect().top + window.pageYOffset;
90 - const floatingHeaderHeight = 160; // about 200px
91 - window.scrollTo({ top: elementYPos - floatingHeaderHeight, behavior: 'smooth'});
90 + const floatingHeaderHeight = 160; // estimated height of floating header
91 + window.scrollTo({ top: elementYPos - floatingHeaderHeight, behavior: 'smooth' });
92 92 subscriber.unsubscribe();
93 93 }, 400);
94 94 }
95 95 });
96 96 }
97 97
98 98 ngOnInit(): void {
99 99 this.activitiesService.openActivityModalEvent$.subscribe((activity: Activity) => {
100 100 this.activityModal?.setActivity(activity);
101 101 this.activityModal?.setVisible(true);
118 118 public addActivity(): void {
119 119 this.activitiesService.emitOpenActivityModalEvent(undefined);
120 120 }
121 121
122 122 public addOrEditMeasurements(activity: Activity): void {
123 123 if (this.measurementsModalEvent) {
124 124 this.measurementsModalEvent.observationType = ActivityUtil.hasUltraSoundMeasurements(activity)
125 125 ? 'ultrasound'
126 126 : 'regular';
127 127
128 - this.measurementsModalEvent.isOpen = true;
129 128 this.measurementsModalEvent.allowTypeChange = !ActivityUtil.hasMeasurements(activity);
130 129 this.measurementsModalEvent.activity = activity;
131 130 this.measurementsModalEvent.allowActivityChange = false;
131 + this.measurementsModalEvent.isOpen = true;
132 132 }
133 133 }
134 134
135 135 @HostListener('window:scroll', [ '$event' ]) // for window scroll events
136 136 public onScroll(): void {
137 137 if (this.divider && this.header) {
138 138 const dividerPosition = this.divider.nativeElement.getBoundingClientRect().top + window.pageYOffset;
139 139 this.dividerPassed = dividerPosition <= (window.scrollY + 200);
140 140 }
141 141 }

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut