Files
dspace-angular/src/app/shared/view-mode-switch/view-mode-switch.component.html
Àlex Magaz Graça d6498d991f Show the button of the default view as active on first load
Using just routerLinkActive doesn't work on first load, the query
parameter might not be defined. Adding 'active' to the class attribute
doesn't work either, it doesn't get removed after switching to the other
view.
2017-10-17 12:52:33 +02:00

20 lines
796 B
HTML

<div class="btn-group" data-toggle="buttons">
<a routerLink="."
[queryParams]="{view: 'list'}"
queryParamsHandling="merge"
(click)="switchViewTo(viewModeEnum.List)"
routerLinkActive="active"
[class.active]="currentMode === viewModeEnum.List"
class="btn btn-secondary">
<i class="fa fa-list" title="{{'search.view-switch.show-list' | translate}}"></i>
</a>
<a routerLink="."
[queryParams]="{view: 'grid'}"
queryParamsHandling="merge"
(click)="switchViewTo(viewModeEnum.Grid)"
routerLinkActive="active"
[class.active]="currentMode !== viewModeEnum.List"
class="btn btn-secondary">
<i class="fa fa-th-large" title="{{'search.view-switch.show-grid' | translate}}"></i>
</a>
</div>