Hiding titles of filter categories when no filter exists

This commit is contained in:
Zoe Roux 2020-09-21 00:50:26 +02:00
parent 64c9921dca
commit c83d80ab51

View File

@ -13,26 +13,30 @@
</div> </div>
<mat-menu #filterMenu="matMenu" class="big-panel"> <mat-menu #filterMenu="matMenu" class="big-panel">
<h4><b>Genres</b></h4> <ng-container *ngIf="this.genres.length > 0">
<mat-chip-list> <h4><b>Genres</b></h4>
<!--suppress AngularInvalidExpressionResultType ('default' color is valid for mat-chip)--> <mat-chip-list>
<mat-chip *ngFor="let genre of this.genres" <!--suppress AngularInvalidExpressionResultType ('default' color is valid for mat-chip)-->
[color]="this.filters.genres.includes(genre) ? 'accent' : 'default'" selected <mat-chip *ngFor="let genre of this.genres"
(click)="this.addFilter('genres', genre)"> [color]="this.filters.genres.includes(genre) ? 'accent' : 'default'" selected
{{genre.name}} (click)="this.addFilter('genres', genre)">
</mat-chip> {{genre.name}}
</mat-chip-list> </mat-chip>
</mat-chip-list>
</ng-container>
<br/> <ng-container *ngIf="this.studios.length > 0">
<h4><b>Studios</b></h4> <br/>
<mat-chip-list> <h4><b>Studios</b></h4>
<!--suppress AngularInvalidExpressionResultType ('default' color is valid for mat-chip)--> <mat-chip-list>
<mat-chip *ngFor="let studio of this.studios" <!--suppress AngularInvalidExpressionResultType ('default' color is valid for mat-chip)-->
[color]="this.filters.studio == studio ? 'accent' : 'default'" selected <mat-chip *ngFor="let studio of this.studios"
(click)="this.addFilter('studio', studio, false)"> [color]="this.filters.studio == studio ? 'accent' : 'default'" selected
{{studio.name}} (click)="this.addFilter('studio', studio, false)">
</mat-chip> {{studio.name}}
</mat-chip-list> </mat-chip>
</mat-chip-list>
</ng-container>
</mat-menu> </mat-menu>
<mat-menu #sortMenu="matMenu"> <mat-menu #sortMenu="matMenu">