Fix view model editor layout (#1473)

* flex container should be as big as the parent container

* add example
This commit is contained in:
Abbie Petchtes
2018-05-23 11:20:28 -07:00
committed by GitHub
parent 04ec9caad1
commit cd0f9b71c5
10 changed files with 99 additions and 20 deletions

View File

@@ -34,18 +34,21 @@ export class DialogContainer implements AfterContentInit {
public modelViewId: string;
@ViewChild(ModelViewContent) private _modelViewContent: ModelViewContent;
constructor(
@Inject(forwardRef(() => ElementRef)) el: ElementRef,
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
@Inject(BOOTSTRAP_SERVICE_ID) bootstrapService: IBootstrapService) {
this._params = bootstrapService.getBootstrapParams(el.nativeElement.tagName) as DialogComponentParams;
this._params = bootstrapService.getBootstrapParams(_el.nativeElement.tagName) as DialogComponentParams;
this.modelViewId = this._params.modelViewId;
}
ngAfterContentInit(): void {
this._modelViewContent.onEvent(event => {
if (event.eventType === ComponentEventType.validityChanged) {
this._params.validityChangedCallback(event.args);
}
});
if (event.eventType === ComponentEventType.validityChanged) {
this._params.validityChangedCallback(event.args);
}
});
let element = <HTMLElement>this._el.nativeElement;
element.style.height = '100%';
element.style.width = '100%';
}
public layout(): void {