Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
ef46a72d3f
|
@ -42,7 +42,7 @@
|
||||||
"rxjs": "^6.5.1",
|
"rxjs": "^6.5.1",
|
||||||
"ts-md5": "^1.2.0",
|
"ts-md5": "^1.2.0",
|
||||||
"tslib": "^2.0.0",
|
"tslib": "^2.0.0",
|
||||||
"uikit": "3.12.2",
|
"uikit": "3.13.10",
|
||||||
"zone.js": "~0.11.4"
|
"zone.js": "~0.11.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -60,7 +60,8 @@ import {ResourcesService} from "./openaireLibrary/monitor/services/resources.ser
|
||||||
</cookie-law>
|
</cookie-law>
|
||||||
<bottom #bottom *ngIf="properties && showMenu" id="bottom" [grantAdvance]="false"
|
<bottom #bottom *ngIf="properties && showMenu" id="bottom" [grantAdvance]="false"
|
||||||
[properties]="properties"></bottom>
|
[properties]="properties"></bottom>
|
||||||
<quick-contact #quickContact *ngIf="showQuickContact && contactForm" (sendEmitter)="send($event)"
|
<quick-contact #quickContact *ngIf="bottomNotIntersecting && displayQuickContact && contactForm"
|
||||||
|
(sendEmitter)="send($event)"
|
||||||
[contactForm]="contactForm" [sending]="sending" [images]="images" [contact]="'Help'"
|
[contactForm]="contactForm" [sending]="sending" [images]="images" [contact]="'Help'"
|
||||||
[organizationTypes]="organizationTypes"
|
[organizationTypes]="organizationTypes"
|
||||||
class="uk-visible@m"></quick-contact>
|
class="uk-visible@m"></quick-contact>
|
||||||
|
@ -79,7 +80,8 @@ export class AppComponent {
|
||||||
header: Header;
|
header: Header;
|
||||||
logoPath: string = 'assets/common-assets/logo-services/monitor/';
|
logoPath: string = 'assets/common-assets/logo-services/monitor/';
|
||||||
/* Contact */
|
/* Contact */
|
||||||
public showQuickContact: boolean;
|
public bottomNotIntersecting: boolean;
|
||||||
|
public displayQuickContact: boolean; // intersecting with specific section in home page
|
||||||
public showGetStarted: boolean = true;
|
public showGetStarted: boolean = true;
|
||||||
public contactForm: UntypedFormGroup;
|
public contactForm: UntypedFormGroup;
|
||||||
public organizationTypes: string[] = [
|
public organizationTypes: string[] = [
|
||||||
|
@ -107,7 +109,7 @@ export class AppComponent {
|
||||||
if (event instanceof NavigationEnd) {
|
if (event instanceof NavigationEnd) {
|
||||||
if (event.url === '/contact-us') {
|
if (event.url === '/contact-us') {
|
||||||
this.quickContactService.setDisplay(false);
|
this.quickContactService.setDisplay(false);
|
||||||
} else if (event.url !== '/contact-us' && !this.showQuickContact) {
|
} else if (event.url !== '/contact-us' && (!this.bottomNotIntersecting || !this.displayQuickContact)) {
|
||||||
this.quickContactService.setDisplay(true);
|
this.quickContactService.setDisplay(true);
|
||||||
}
|
}
|
||||||
this.showGetStarted = event.url !== '/get-started';
|
this.showGetStarted = event.url !== '/get-started';
|
||||||
|
@ -135,7 +137,7 @@ export class AppComponent {
|
||||||
this.reset();
|
this.reset();
|
||||||
}));
|
}));
|
||||||
this.subscriptions.push(this.quickContactService.isDisplayed.subscribe(display => {
|
this.subscriptions.push(this.quickContactService.isDisplayed.subscribe(display => {
|
||||||
this.showQuickContact = display;
|
this.displayQuickContact = display;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,25 +147,23 @@ export class AppComponent {
|
||||||
rootMargin: '0px',
|
rootMargin: '0px',
|
||||||
threshold: 0.1
|
threshold: 0.1
|
||||||
};
|
};
|
||||||
let intersectionObserver = new IntersectionObserver(entries => {
|
|
||||||
entries.forEach(entry => {
|
let intersectionObserver = new IntersectionObserver(entries => {
|
||||||
if (entry.isIntersecting && this.showQuickContact) {
|
entries.forEach(entry => {
|
||||||
this.showQuickContact = false;
|
// if (entry.isIntersecting && this.showQuickContact) {
|
||||||
this.quickContactService.setDisplay(this.showQuickContact);
|
this.bottomNotIntersecting = !entry.isIntersecting;
|
||||||
} else if (!entry.isIntersecting && !this.showQuickContact) {
|
|
||||||
this.showQuickContact = true;
|
|
||||||
this.quickContactService.setDisplay(this.showQuickContact);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}, options);
|
}, options);
|
||||||
intersectionObserver.observe(this.bottom.nativeElement);
|
intersectionObserver.observe(this.bottom.nativeElement);
|
||||||
this.subscriptions.push(intersectionObserver);
|
this.subscriptions.push(intersectionObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngOnDestroy() {
|
public ngOnDestroy() {
|
||||||
this.subscriptions.forEach(value => {
|
this.subscriptions.forEach(value => {
|
||||||
if (value instanceof Subscriber) {
|
if (value instanceof Subscriber) {
|
||||||
value.unsubscribe();
|
value.unsubscribe();
|
||||||
|
} else if (typeof IntersectionObserver !== "undefined" && value instanceof IntersectionObserver) {
|
||||||
|
value.disconnect();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.userManagementService.clearSubscriptions();
|
this.userManagementService.clearSubscriptions();
|
||||||
|
|
Loading…
Reference in New Issue