Fix bodyHeight in full screen modal.

This commit is contained in:
Konstantinos Triantafyllou 2023-07-04 11:08:39 +03:00
parent 1d31c7b234
commit 18b5ce2201
1 changed files with 7 additions and 7 deletions

View File

@ -1,16 +1,16 @@
import {
AfterViewInit, ChangeDetectorRef,
AfterViewInit,
ChangeDetectorRef,
Component,
ElementRef,
EventEmitter, HostListener,
EventEmitter,
HostListener,
Input,
OnDestroy,
OnInit,
Output,
ViewChild
} from "@angular/core";
import {fromEvent, Subscription} from 'rxjs';
import {delay} from "rxjs/operators";
import {Subscription} from 'rxjs';
import {HelperFunctions} from "../../HelperFunctions.class";
import {LayoutService} from "../../../dashboard/sharedComponents/sidebar/layout.service";
@ -43,7 +43,7 @@ declare var ResizeObserver;
</button>
</div>
</div>
<div #body class="uk-modal-body uk-overflow-auto" [ngStyle]="{'height.px': bodyHeight}">
<div #body class="uk-modal-body uk-overflow-auto uk-border-box" [ngStyle]="{'height.px': bodyHeight}">
<div class="uk-container uk-height-1-1" [ngClass]="classBody">
<ng-content></ng-content>
</div>
@ -111,7 +111,7 @@ export class FullScreenModalComponent implements AfterViewInit, OnDestroy {
/* Height = Viewport - header - (Body padding) */
changeHeight() {
if(typeof window !== "undefined" && this.header) {
this.bodyHeight = window.innerHeight - this.header.nativeElement.clientHeight - (this.isMobile?40:80);
this.bodyHeight = window.innerHeight - this.header.nativeElement.offsetHeight;
this.cdr.detectChanges();
}
}