Skip to content

Commit

Permalink
fixed two layout issues in model view components (microsoft#1647)
Browse files Browse the repository at this point in the history
  • Loading branch information
llali authored and kburtram committed Jun 18, 2018
1 parent 83c01c6 commit a2a87f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/sql/parts/modelComponents/componentBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('%')) {
Expand Down
2 changes: 1 addition & 1 deletion src/sql/parts/modelComponents/dropdown.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit a2a87f8

Please sign in to comment.