Collapsible properties (#771)

* started moving properties to home tab

* moved properties

* refactored panel in dashboard

* fix errors

* fix miss-naming

* added collapsable properties

* revert unnecessary change

* add icon for collapsing properties
This commit is contained in:
Anthony Dresser
2018-03-05 10:06:18 -08:00
committed by GitHub
parent 2e67d03b56
commit 692ed02df8
14 changed files with 146 additions and 24 deletions

View File

@@ -43,6 +43,8 @@ export class ExplorerWidget extends DashboardWidget implements IDashboardWidget,
private _treeDataSource = new ExplorerDataSource();
private _treeFilter = new ExplorerFilter();
private _inited = false;
@ViewChild('input') private _inputContainer: ElementRef;
@ViewChild('table') private _tableContainer: ElementRef;
@@ -58,6 +60,8 @@ export class ExplorerWidget extends DashboardWidget implements IDashboardWidget,
}
ngOnInit() {
this._inited = true;
let inputOptions: IInputOptions = {
placeholder: this._config.context === 'database' ? nls.localize('seachObjects', 'Search by name of type (a:, t:, v:, f:, or sp:)') : nls.localize('searchDatabases', 'Search databases')
};
@@ -120,6 +124,8 @@ export class ExplorerWidget extends DashboardWidget implements IDashboardWidget,
}
public layout(): void {
this._tree.layout(getContentHeight(this._tableContainer.nativeElement));
if (this._inited) {
this._tree.layout(getContentHeight(this._tableContainer.nativeElement));
}
}
}

View File

@@ -46,6 +46,8 @@ export class TasksWidget extends DashboardWidget implements IDashboardWidget, On
private _scrollableElement: ScrollableElement;
private $container: Builder;
private _inited = false;
@ViewChild('container', { read: ElementRef }) private _container: ElementRef;
constructor(
@@ -67,6 +69,7 @@ export class TasksWidget extends DashboardWidget implements IDashboardWidget, On
}
ngOnInit() {
this._inited = true;
this._register(registerThemingParticipant(this.registerThemeing));
this._computeContainer();
@@ -137,11 +140,13 @@ export class TasksWidget extends DashboardWidget implements IDashboardWidget, On
}
public layout(): void {
this._computeContainer();
// Update scrollbar
this._scrollableElement.setScrollDimensions({
width: DOM.getContentWidth(this._container.nativeElement),
scrollWidth: DOM.getContentWidth(this.$container.getHTMLElement()) + 18 // right padding
});
if (this._inited) {
this._computeContainer();
// Update scrollbar
this._scrollableElement.setScrollDimensions({
width: DOM.getContentWidth(this._container.nativeElement),
scrollWidth: DOM.getContentWidth(this.$container.getHTMLElement()) + 18 // right padding
});
}
}
}