mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 21:52:24 +00:00
index tree: prevent root from changing collapse state
This commit is contained in:
parent
174c9c69ec
commit
8a9f89c285
1 changed files with 8 additions and 4 deletions
|
@ -276,11 +276,15 @@ export class IndexTreeModel<T extends Exclude<any, undefined>, TFilterData = voi
|
||||||
private _setNodeCollapseState(node: IMutableTreeNode<T, TFilterData>, collapsible: boolean, collapsed: boolean, recursive: boolean, deep: boolean): boolean {
|
private _setNodeCollapseState(node: IMutableTreeNode<T, TFilterData>, collapsible: boolean, collapsed: boolean, recursive: boolean, deep: boolean): boolean {
|
||||||
let result = node.collapsible !== collapsible || node.collapsed !== collapsed;
|
let result = node.collapsible !== collapsible || node.collapsed !== collapsed;
|
||||||
|
|
||||||
node.collapsible = collapsible;
|
if (node === this.root) {
|
||||||
node.collapsed = collapsed;
|
result = false;
|
||||||
|
} else {
|
||||||
|
node.collapsible = collapsible;
|
||||||
|
node.collapsed = collapsed;
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
this._onDidChangeCollapseState.fire({ node, deep });
|
this._onDidChangeCollapseState.fire({ node, deep });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recursive) {
|
if (recursive) {
|
||||||
|
|
Loading…
Reference in a new issue