mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 09:35:37 -05:00
fixed the layout issue in model view containers (#1548)
* fixed the layout issue in model view containers * fixed the sample
This commit is contained in:
@@ -6,7 +6,7 @@ import 'vs/css!./flexContainer';
|
||||
|
||||
import {
|
||||
Component, Input, Inject, ChangeDetectorRef, forwardRef, ComponentFactoryResolver,
|
||||
ViewChild, ElementRef, Injector, OnDestroy, OnInit
|
||||
ViewChild, ViewChildren, ElementRef, Injector, OnDestroy, OnInit, QueryList
|
||||
} from '@angular/core';
|
||||
|
||||
import * as types from 'vs/base/common/types';
|
||||
@@ -17,6 +17,7 @@ import { ComponentHostDirective } from 'sql/parts/dashboard/common/componentHost
|
||||
import { DashboardServiceInterface } from 'sql/parts/dashboard/services/dashboardServiceInterface.service';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { ModelComponentWrapper } from 'sql/parts/modelComponents/modelComponentWrapper.component';
|
||||
|
||||
export class ItemDescriptor<T> {
|
||||
constructor(public descriptor: IComponentDescriptor, public config: T) { }
|
||||
@@ -152,6 +153,7 @@ export abstract class ComponentBase extends Disposable implements IComponent, On
|
||||
export abstract class ContainerBase<T> extends ComponentBase {
|
||||
protected items: ItemDescriptor<T>[];
|
||||
|
||||
@ViewChildren(ModelComponentWrapper) protected _componentWrappers: QueryList<ModelComponentWrapper>;
|
||||
constructor(
|
||||
_changeRef: ChangeDetectorRef
|
||||
) {
|
||||
@@ -189,5 +191,14 @@ export abstract class ContainerBase<T> extends ComponentBase {
|
||||
});
|
||||
}
|
||||
|
||||
public layout(): void {
|
||||
if (this._componentWrappers) {
|
||||
this._componentWrappers.forEach(wrapper => {
|
||||
wrapper.layout();
|
||||
});
|
||||
}
|
||||
super.layout();
|
||||
}
|
||||
|
||||
abstract setLayout(layout: any): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user