fixed two layout issues in model view components (#1647)

This commit is contained in:
Leila Lali
2018-06-18 12:23:54 -07:00
committed by Karl Burtram
parent 83c01c6bcb
commit a2a87f8d2b
2 changed files with 10 additions and 2 deletions

View File

@@ -138,9 +138,17 @@ export abstract class ComponentBase extends Disposable implements IComponent, On
return +size;
}
protected getWidth(): string {
return this.width ? this.convertSize(this.width) : '';
}
protected getHeight(): string {
return this.height ? this.convertSize(this.height) : '';
}
protected convertSize(size: number | string): string {
if (types.isUndefinedOrNull(size)) {
return '';
return '100%';
}
let convertedSize: string = size ? size.toString() : '100%';
if (!convertedSize.toLowerCase().endsWith('px') && !convertedSize.toLowerCase().endsWith('%')) {

View File

@@ -27,7 +27,7 @@ import { attachListStyler } from 'vs/platform/theme/common/styler';
selector: 'modelview-dropdown',
template: `
<div>
<div [style.width]="getWidth()">
<div [style.display]="getEditableDisplay()" #editableDropDown style="width: 100%;"></div>
<div [style.display]="getNotEditableDisplay()" #dropDown style="width: 100%;"></div>
</div>