Skip to content

Commit

Permalink
feat: default sort for expanded composition
Browse files Browse the repository at this point in the history
  • Loading branch information
69pmb committed Feb 21, 2024
1 parent b5a13f9 commit 8962b9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/list-fichier/list-fichier.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
<mat-table
matSort
[dataSource]="displayedCompositions"
[matSortActive]="'rank'"
[matSortActive]="fichier.sorted ? 'rank' : 'score'"
[matSortDirection]="'desc'"
(matSortChange)="
paginatorComposition.firstPage(); onSortComposition($any($event))
Expand Down
5 changes: 4 additions & 1 deletion src/app/list-fichier/list-fichier.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ export class ListFichierComponent
this.expandedElement =
this.expandedElement === element ? undefined : element;
if (this.expandedElement) {
this.sortComposition = {active: 'rank', direction: 'asc'};
this.sortComposition = {
active: element.sorted ? 'rank' : 'score',
direction: 'asc',
};
this.onSortComposition(this.sortComposition);
}
}
Expand Down

0 comments on commit 8962b9c

Please sign in to comment.