2024-01-09 15:05:19 +01:00
|
|
|
import {ChangeDetectorRef, Component} from "@angular/core";
|
|
|
|
import {BaseComponent} from "../../openaireLibrary/sharedComponents/base/base.component";
|
|
|
|
import {ActivatedRoute, Router} from "@angular/router";
|
|
|
|
import {PiwikService} from "src/app/openaireLibrary/utils/piwik/piwik.service";
|
|
|
|
import {Meta, Title} from "@angular/platform-browser";
|
|
|
|
import {SEOService} from "src/app/openaireLibrary/sharedComponents/SEO/SEO.service";
|
|
|
|
import {StakeholderEntities} from "../../openaireLibrary/monitor/entities/stakeholder";
|
2024-01-08 15:57:55 +01:00
|
|
|
|
|
|
|
@Component({
|
2024-01-09 12:37:17 +01:00
|
|
|
selector: 'the-five-monitors',
|
2024-01-09 15:05:19 +01:00
|
|
|
templateUrl: 'the-five-monitors.component.html',
|
|
|
|
styleUrls: ['the-five-monitors.component.less']
|
2024-01-08 15:57:55 +01:00
|
|
|
})
|
2024-01-09 15:05:19 +01:00
|
|
|
export class TheFiveMonitorsComponent extends BaseComponent{
|
|
|
|
title = 'The 5 Monitors';
|
|
|
|
description = 'The 5 Monitors';
|
|
|
|
public sections: string[] = ['RPOs', 'RFOs', 'Researchers', 'Repositories'];
|
|
|
|
public offset: number;
|
|
|
|
public stakeholderEntities = StakeholderEntities;
|
|
|
|
public shouldSticky: boolean = true;
|
|
|
|
|
|
|
|
constructor(protected _route: ActivatedRoute,
|
|
|
|
protected _piwikService: PiwikService,
|
|
|
|
protected _meta: Meta,
|
|
|
|
protected seoService: SEOService,
|
|
|
|
protected _title: Title,
|
|
|
|
protected _router: Router,
|
|
|
|
private cdr: ChangeDetectorRef) {
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
this.setMetadata();
|
|
|
|
}
|
|
|
|
|
|
|
|
ngAfterViewInit() {
|
|
|
|
if (typeof document !== 'undefined') {
|
|
|
|
this.offset = Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--header-height'));
|
|
|
|
this.cdr.detectChanges();
|
|
|
|
this.observeBottom();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private observeBottom() {
|
|
|
|
let bottom = document.getElementById('bottom');
|
|
|
|
if (bottom) {
|
|
|
|
let bottomObs = new IntersectionObserver(entries => {
|
|
|
|
entries.forEach(entry => {
|
|
|
|
this.shouldSticky = !entry.isIntersecting;
|
|
|
|
this.cdr.detectChanges();
|
|
|
|
})
|
|
|
|
});
|
|
|
|
this.subscriptions.push(bottomObs);
|
|
|
|
bottomObs.observe(bottom);
|
|
|
|
}
|
2024-01-08 15:57:55 +01:00
|
|
|
}
|
2024-01-09 12:37:17 +01:00
|
|
|
}
|