mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-10 12:35:07 +00:00
(Toolbar) Fixed: Unnecessary _.find in setLanguage method, Closes #66
(Navigation) Fixed: Removed id causing a style issue
This commit is contained in:
parent
64e0451dc6
commit
984004d07a
|
@ -4,7 +4,7 @@ fuse-navigation {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1 0 auto;
|
flex: 1 0 auto;
|
||||||
|
|
||||||
#main-navigation {
|
> .nav {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
|
|
||||||
<mat-menu #languageMenu="matMenu" [overlapTrigger]="false">
|
<mat-menu #languageMenu="matMenu" [overlapTrigger]="false">
|
||||||
|
|
||||||
<button mat-menu-item *ngFor="let lang of languages" (click)="setLanguage(lang.id)">
|
<button mat-menu-item *ngFor="let lang of languages" (click)="setLanguage(lang)">
|
||||||
<span fxLayout="row" fxLayoutAlign="start center">
|
<span fxLayout="row" fxLayoutAlign="start center">
|
||||||
<img class="flag mr-16" [src]="'assets/images/flags/'+lang.flag+'.png'">
|
<img class="flag mr-16" [src]="'assets/images/flags/'+lang.flag+'.png'">
|
||||||
<span class="iso">{{lang.title}}</span>
|
<span class="iso">{{lang.title}}</span>
|
||||||
|
|
|
@ -160,14 +160,14 @@ export class ToolbarComponent implements OnInit, OnDestroy
|
||||||
/**
|
/**
|
||||||
* Set the language
|
* Set the language
|
||||||
*
|
*
|
||||||
* @param langId
|
* @param lang
|
||||||
*/
|
*/
|
||||||
setLanguage(langId): void
|
setLanguage(lang): void
|
||||||
{
|
{
|
||||||
// Set the selected language for toolbar
|
// Set the selected language for the toolbar
|
||||||
this.selectedLanguage = _.find(this.languages, {'id': langId});
|
this.selectedLanguage = lang;
|
||||||
|
|
||||||
// Use the selected language for translations
|
// Use the selected language for translations
|
||||||
this._translateService.use(langId);
|
this._translateService.use(lang.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user