|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import {ChangeDetectorRef, Component, ViewChild} from '@angular/core';
|
|
|
|
|
import {ChangeDetectorRef, Component, ElementRef, ViewChild} from '@angular/core';
|
|
|
|
|
import {ActivatedRoute, Router} from '@angular/router';
|
|
|
|
|
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
|
|
|
|
|
import {MenuItem} from './openaireLibrary/sharedComponents/menu';
|
|
|
|
@ -51,9 +51,9 @@ import {LayoutService} from './openaireLibrary/dashboard/sharedComponents/sideba
|
|
|
|
|
ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.03" points="7 4 13 10 7 16"></polyline></svg>
|
|
|
|
|
</span></a>
|
|
|
|
|
</cookie-law>
|
|
|
|
|
<bottom id="bottom" #bottom *ngIf="isClient && properties" [properties]="properties"></bottom>
|
|
|
|
|
<quick-contact #quickContact *ngIf="showQuickContact && contactForm" (sendEmitter)="send($event)"
|
|
|
|
|
[contactForm]="contactForm" [sending]="sending" [contact]="'Help'"></quick-contact>
|
|
|
|
|
<bottom id="bottom" *ngIf="isClient && properties" [properties]="properties"></bottom>
|
|
|
|
|
<modal-alert #modal [overflowBody]="false"></modal-alert>
|
|
|
|
|
`
|
|
|
|
|
})
|
|
|
|
@ -70,6 +70,7 @@ export class AppComponent {
|
|
|
|
|
public sending: boolean = false;
|
|
|
|
|
@ViewChild('quickContact') quickContact: QuickContactComponent;
|
|
|
|
|
@ViewChild('modal') modal: AlertModal;
|
|
|
|
|
@ViewChild('bottom', {read: ElementRef}) bottom: ElementRef;
|
|
|
|
|
|
|
|
|
|
subscriptions = [];
|
|
|
|
|
|
|
|
|
@ -126,6 +127,33 @@ export class AppComponent {
|
|
|
|
|
this.userManagementService.clearSubscriptions();
|
|
|
|
|
this.smoothScroll.clearSubscriptions();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngAfterViewInit() {
|
|
|
|
|
if (typeof window !== "undefined") {
|
|
|
|
|
this.createObservers();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
createObservers() {
|
|
|
|
|
let options = {
|
|
|
|
|
root: null,
|
|
|
|
|
rootMargin: '300px',
|
|
|
|
|
threshold: 1.0
|
|
|
|
|
};
|
|
|
|
|
let intersectionObserver = new IntersectionObserver(entries => {
|
|
|
|
|
entries.forEach(entry => {
|
|
|
|
|
if (entry.isIntersecting && this.showQuickContact) {
|
|
|
|
|
this.showQuickContact = false;
|
|
|
|
|
this.quickContactService.setDisplay(this.showQuickContact);
|
|
|
|
|
} else if (!entry.isIntersecting && !this.showQuickContact) {
|
|
|
|
|
this.showQuickContact = true;
|
|
|
|
|
this.quickContactService.setDisplay(this.showQuickContact);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}, options);
|
|
|
|
|
intersectionObserver.observe(this.bottom.nativeElement);
|
|
|
|
|
this.subscriptions.push(intersectionObserver);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
buildMenu() {
|
|
|
|
|
this.userMenuItems = [];
|
|
|
|
|