fixed the bug with collapsibleState (#2189)

This commit is contained in:
Leila Lali
2018-08-08 12:27:55 -07:00
committed by GitHub
parent 39bfd69dc9
commit 48d5cc554c
3 changed files with 12 additions and 2 deletions

View File

@@ -75,6 +75,14 @@ export class TreeNode implements sqlops.TreeComponentItem {
this.data.label = value;
}
public get collapsibleState(): vscode.TreeItemCollapsibleState {
if (!this._isAlwaysLeaf) {
return vscode.TreeItemCollapsibleState.Collapsed;
} else {
vscode.TreeItemCollapsibleState.None;
}
}
public get label(): string {
return this.data.label;
}
@@ -265,6 +273,7 @@ export class TreeDataProvider implements sqlops.TreeComponentDataProvider<TreeNo
let item: sqlops.TreeComponentItem = {};
item.label = element.label;
item.checked = element.checked;
item.collapsibleState = element.collapsibleState;
item.iconPath = vscode.Uri.file(path.join(__dirname, '..', 'media', 'monitor.svg'));
return item;
}