TSK-474 Change classification searcher input style and collapse tree after remove filter
This commit is contained in:
parent
4450002a81
commit
3545df7448
|
@ -16,7 +16,8 @@
|
|||
}
|
||||
|
||||
input.filter-input {
|
||||
margin: 10px 0px;
|
||||
margin: 10px 2px;
|
||||
height: 32px;
|
||||
width: 100%;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ export class TaskanaTreeComponent implements OnInit, AfterViewChecked {
|
|||
@Input() filterText: string;
|
||||
|
||||
private filterTextOld: string
|
||||
private beforeFilteringState: ITreeState;
|
||||
|
||||
options: ITreeOptions = {
|
||||
displayField: 'name',
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue