Skip to content

Commit

Permalink
TSK-474 Change classification searcher input style and collapse tree …
Browse files Browse the repository at this point in the history
…after remove filter
  • Loading branch information
Martin Rojas Miguel Angel authored and mustaphazorgati committed May 2, 2018
1 parent 4450002 commit 3545df7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
}

input.filter-input {
margin: 10px 0px;
margin: 10px 2px;
height: 32px;
width: 100%;
padding-left: 10px;
}
11 changes: 9 additions & 2 deletions web/src/app/shared/tree/tree.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export class TaskanaTreeComponent implements OnInit, AfterViewChecked {
@Input() filterText: string;

private filterTextOld: string
private beforeFilteringState: ITreeState;

options: ITreeOptions = {
displayField: 'name',
Expand Down Expand Up @@ -59,7 +60,8 @@ export class TaskanaTreeComponent implements OnInit, AfterViewChecked {
}
if (this.filterTextOld !== this.filterText) {
this.filterTextOld = this.filterText;
this.filterNodes(this.filterText)
this.filterNodes(this.filterText);
this.manageTreeState();
}
}

Expand Down Expand Up @@ -102,9 +104,14 @@ export class TaskanaTreeComponent implements OnInit, AfterViewChecked {
private filterNodes(text) {
this.tree.treeModel.filterNodes((node) => {
return (node.data.name.toUpperCase().includes(text.toUpperCase())
|| node.data.key.toUpperCase().includes(text.toUpperCase()));
|| node.data.key.toUpperCase().includes(text.toUpperCase()));
});
}
private manageTreeState() {
if (this.filterText === '') {
this.tree.treeModel.collapseAll();
}
}

}

Expand Down

0 comments on commit 3545df7

Please sign in to comment.