mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-04 17:23:45 -05:00
Fix view model editor layout (#1473)
* flex container should be as big as the parent container * add example
This commit is contained in:
@@ -15,6 +15,8 @@ import { DashboardServiceInterface } from 'sql/parts/dashboard/services/dashboar
|
||||
import { ContainerBase } from 'sql/parts/modelComponents/componentBase';
|
||||
import { ModelComponentWrapper } from 'sql/parts/modelComponents/modelComponentWrapper.component';
|
||||
|
||||
import types = require('vs/base/common/types');
|
||||
|
||||
class FlexItem {
|
||||
constructor(public descriptor: IComponentDescriptor, public config: FlexItemLayout) {}
|
||||
}
|
||||
@@ -68,10 +70,16 @@ export default class FlexContainer extends ContainerBase<FlexItemLayout> impleme
|
||||
|
||||
public setLayout (layout: FlexLayout): void {
|
||||
this._flexFlow = layout.flexFlow ? layout.flexFlow : '';
|
||||
this._justifyContent= layout.justifyContent ? layout.justifyContent : '';
|
||||
this._alignItems= layout.alignItems ? layout.alignItems : '';
|
||||
this._alignContent= layout.alignContent ? layout.alignContent : '';
|
||||
this._height= layout.height ? layout.height + 'px' : '';
|
||||
this._justifyContent = layout.justifyContent ? layout.justifyContent : '';
|
||||
this._alignItems = layout.alignItems ? layout.alignItems : '';
|
||||
this._alignContent = layout.alignContent ? layout.alignContent : '';
|
||||
if (types.isUndefinedOrNull(layout.height)) {
|
||||
this._height = '';
|
||||
} else if (types.isNumber(layout.height)) {
|
||||
this._height = layout.height + 'px';
|
||||
} else {
|
||||
this._height = layout.height;
|
||||
}
|
||||
this.layout();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
.flexContainer {
|
||||
display: flex;
|
||||
padding: 5px;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
.model-view-container {
|
||||
height: 100%;
|
||||
width : 100%;
|
||||
}
|
||||
@@ -2,6 +2,8 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import 'vs/css!./modelViewEditor';
|
||||
|
||||
import { Builder, $ } from 'vs/base/browser/builder';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
|
||||
@@ -24,7 +24,7 @@ import { ViewBase } from 'sql/parts/modelComponents/viewBase';
|
||||
@Component({
|
||||
selector: 'modelview-content',
|
||||
template: `
|
||||
<div *ngIf="rootDescriptor">
|
||||
<div *ngIf="rootDescriptor" style="width: 100%; height: 100%;">
|
||||
<model-component-wrapper [descriptor]="rootDescriptor" [modelStore]="modelStore">
|
||||
</model-component-wrapper>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user