From 1ad1a2c4ebf3124f782ef5fbb0fb50005db9da4b Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 4 Jun 2024 12:59:35 +0300 Subject: [PATCH] [develop]: Use is bottom intersecting in about and update libraries --- src/app/about/about.component.ts | 28 ++++++++-------------------- src/app/openaireLibrary | 2 +- src/assets/common-assets | 2 +- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/app/about/about.component.ts b/src/app/about/about.component.ts index fbd2f8c..27dd1b6 100644 --- a/src/app/about/about.component.ts +++ b/src/app/about/about.component.ts @@ -9,6 +9,7 @@ import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.compo import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties"; import {properties} from "../../environments/environment"; import {StakeholderEntities} from "../openaireLibrary/monitor/entities/stakeholder"; +import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service"; @Component({ selector: 'about', @@ -583,11 +584,7 @@ import {StakeholderEntities} from "../openaireLibrary/monitor/entities/stakehold `, - styles: [` - .custom-translate-bottom-left { - transform: translate(-20%, 20%); - } - `] + styleUrls: ['about.component.less'] }) export class AboutComponent { public url: string = null; @@ -607,6 +604,7 @@ export class AboutComponent { private _title: Title, private seoService: SEOService, private _piwikService: PiwikService, + private layoutService: LayoutService, private helper: HelperService, private cdr: ChangeDetectorRef) { } @@ -621,10 +619,14 @@ export class AboutComponent { } ngAfterViewInit() { + this.subscriptions.push(this.layoutService.isBottomIntersecting.subscribe(isBottomIntersecting => { + this.shouldSticky = !isBottomIntersecting; + this.cdr.detectChanges(); + })); if (typeof document !== 'undefined') { this.offset = Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--header-height')); this.cdr.detectChanges(); - this.observeBottom(); + } } @@ -636,20 +638,6 @@ export class AboutComponent { }); } - 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); - } - } - private updateDescription(description: string) { this._meta.updateTag({content: description}, "name='description'"); this._meta.updateTag({content: description}, "property='og:description'"); diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 5db039e..9ae1ee9 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 5db039ea0d23fba297af306d24e4a74ea5050ca3 +Subproject commit 9ae1ee928a7c467540cefe3ffea96efe54a91456 diff --git a/src/assets/common-assets b/src/assets/common-assets index e48bf94..c5ba870 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit e48bf941bcdc567a3d09826b5686e70d43fafd46 +Subproject commit c5ba8700be5b8fcf98522fe167246281545d7985