Fix bodyHeight in full screen modal.
This commit is contained in:
parent
1d31c7b234
commit
18b5ce2201
|
@ -1,16 +1,16 @@
|
||||||
import {
|
import {
|
||||||
AfterViewInit, ChangeDetectorRef,
|
AfterViewInit,
|
||||||
|
ChangeDetectorRef,
|
||||||
Component,
|
Component,
|
||||||
ElementRef,
|
ElementRef,
|
||||||
EventEmitter, HostListener,
|
EventEmitter,
|
||||||
|
HostListener,
|
||||||
Input,
|
Input,
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
OnInit,
|
|
||||||
Output,
|
Output,
|
||||||
ViewChild
|
ViewChild
|
||||||
} from "@angular/core";
|
} from "@angular/core";
|
||||||
import {fromEvent, Subscription} from 'rxjs';
|
import {Subscription} from 'rxjs';
|
||||||
import {delay} from "rxjs/operators";
|
|
||||||
import {HelperFunctions} from "../../HelperFunctions.class";
|
import {HelperFunctions} from "../../HelperFunctions.class";
|
||||||
import {LayoutService} from "../../../dashboard/sharedComponents/sidebar/layout.service";
|
import {LayoutService} from "../../../dashboard/sharedComponents/sidebar/layout.service";
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ declare var ResizeObserver;
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</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">
|
<div class="uk-container uk-height-1-1" [ngClass]="classBody">
|
||||||
<ng-content></ng-content>
|
<ng-content></ng-content>
|
||||||
</div>
|
</div>
|
||||||
|
@ -111,7 +111,7 @@ export class FullScreenModalComponent implements AfterViewInit, OnDestroy {
|
||||||
/* Height = Viewport - header - (Body padding) */
|
/* Height = Viewport - header - (Body padding) */
|
||||||
changeHeight() {
|
changeHeight() {
|
||||||
if(typeof window !== "undefined" && this.header) {
|
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();
|
this.cdr.detectChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue