Merge remote-tracking branch 'origin/develop'

This commit is contained in:
Konstantinos Triantafyllou 2023-05-09 13:07:40 +03:00
commit ba89dc1ce2
7 changed files with 36 additions and 27 deletions

View File

@ -13,7 +13,6 @@ import {
import {LayoutService, SidebarItem} from "../sidebar/layout.service"; import {LayoutService, SidebarItem} from "../sidebar/layout.service";
declare var UIkit; declare var UIkit;
declare var ResizeObserver;
@Component({ @Component({
selector: '[page-content]', selector: '[page-content]',
@ -99,8 +98,12 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy {
ngAfterViewInit() { ngAfterViewInit() {
if (typeof document !== "undefined") { if (typeof document !== "undefined") {
if (this.sticky_footer) {
this.initFooter();
this.observeStickyFooter(); this.observeStickyFooter();
}
if (this.shouldSticky && typeof document !== 'undefined') { if (this.shouldSticky && typeof document !== 'undefined') {
setTimeout(() => {
this.sticky.header = UIkit.sticky((this.headerSticky ? this.header.nativeElement : this.actions.nativeElement), { this.sticky.header = UIkit.sticky((this.headerSticky ? this.header.nativeElement : this.actions.nativeElement), {
offset: this.offset offset: this.offset
}); });
@ -112,10 +115,7 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy {
this.isStickyActive = false; this.isStickyActive = false;
this.cdr.detectChanges(); this.cdr.detectChanges();
})); }));
} });
if (this.sticky_footer) {
let footer_offset = this.calcStickyFooterOffset(this.sticky_footer.nativeElement);
this.sticky.footer = UIkit.sticky(this.sticky_footer.nativeElement, {bottom: true, offset: footer_offset});
} }
} }
} }
@ -124,12 +124,16 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy {
this.subscriptions.forEach(subscription => { this.subscriptions.forEach(subscription => {
if (typeof ResizeObserver !== "undefined" && subscription instanceof ResizeObserver) { if (typeof ResizeObserver !== "undefined" && subscription instanceof ResizeObserver) {
subscription.disconnect(); subscription.disconnect();
} else if (typeof ResizeObserver !== "undefined" && subscription instanceof IntersectionObserver) { } else if (typeof IntersectionObserver !== "undefined" && subscription instanceof IntersectionObserver) {
subscription.disconnect(); subscription.disconnect();
} }
}); });
} }
initFooter() {
let footer_offset = this.calcStickyFooterOffset(this.sticky_footer.nativeElement);
this.sticky.footer = UIkit.sticky(this.sticky_footer.nativeElement, {bottom: true, offset: footer_offset});
}
/** /**
* Workaround for sticky not update bug when sidebar is toggled. * Workaround for sticky not update bug when sidebar is toggled.
@ -206,8 +210,7 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy {
let resizeObs = new ResizeObserver(entries => { let resizeObs = new ResizeObserver(entries => {
entries.forEach(entry => { entries.forEach(entry => {
setTimeout(() => { setTimeout(() => {
this.sticky.footer.offset = this.calcStickyFooterOffset(entry.target); this.initFooter();
this.cdr.detectChanges();
}); });
}) })
}); });

View File

@ -59,7 +59,7 @@ export class LayoutService {
/** /**
* Add hasQuickContact: false on data of route config, if the quick-contact fixed button is not needed. * Add hasQuickContact: false on data of route config, if the quick-contact fixed button is not needed.
*/ */
private hasQuickContactSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true); private hasQuickContactSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
/** /**
* Add activeMenuItem: string on data of route config, if page should activate a specific MenuItem and route url does not match. * Add activeMenuItem: string on data of route config, if page should activate a specific MenuItem and route url does not match.
*/ */

View File

@ -49,7 +49,9 @@ export class SideBarComponent implements OnInit, AfterViewInit, OnDestroy, OnCha
} }
ngAfterViewInit() { ngAfterViewInit() {
setTimeout(() => {
this.toggle(true); this.toggle(true);
});
} }
ngOnChanges(changes: SimpleChanges) { ngOnChanges(changes: SimpleChanges) {

View File

@ -0,0 +1,3 @@
.uk-width-medium {
width: 350px;
}

View File

@ -50,7 +50,7 @@ declare var ResizeObserver;
</div> </div>
<div class="uk-section uk-container uk-container-large" uk-scrollspy-class> <div class="uk-section uk-container uk-container-large" uk-scrollspy-class>
<div id="parentContainer" class="uk-grid uk-grid-large" uk-grid> <div id="parentContainer" class="uk-grid uk-grid-large" uk-grid>
<div class="uk-width-1-4 uk-margin-top"> <div class="uk-width-medium uk-margin-top">
<div class="uk-sticky" uk-sticky="bottom: !#parentContainer; offset: 100;"> <div class="uk-sticky" uk-sticky="bottom: !#parentContainer; offset: 100;">
<slider-tabs type="scrollable" position="left"> <slider-tabs type="scrollable" position="left">
<slider-tab tabId="entities" tabTitle="1. Entities"></slider-tab> <slider-tab tabId="entities" tabTitle="1. Entities"></slider-tab>
@ -116,7 +116,8 @@ declare var ResizeObserver;
</div> </div>
</div> </div>
</div> </div>
` `,
styleUrls: ['terminology.component.less']
}) })
export class TerminologyComponent implements OnInit, OnDestroy, AfterViewInit, AfterContentChecked { export class TerminologyComponent implements OnInit, OnDestroy, AfterViewInit, AfterContentChecked {
public tab: 'entities' | 'attributes' = 'entities'; public tab: 'entities' | 'attributes' = 'entities';

View File

@ -5,7 +5,7 @@ import { BehaviorSubject, Observable } from "rxjs";
providedIn: "root" providedIn: "root"
}) })
export class QuickContactService { export class QuickContactService {
private display: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true); private display: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
public get isDisplayed(): Observable<boolean> { public get isDisplayed(): Observable<boolean> {
return this.display.asObservable(); return this.display.asObservable();

View File

@ -60,7 +60,7 @@ export class EGIDataTransferComponent {
} }
ngAfterViewInit() { ngAfterViewInit() {
if(this.isOpen){ if(this.isOpen && typeof document !== 'undefined'){
this.open(); this.open();
} }
} }