(Toolbar) Fixed: Unnecessary _.find in setLanguage method, Closes #66

(Navigation) Fixed: Removed id causing a style issue
This commit is contained in:
Sercan Yemen 2018-07-02 13:22:14 +03:00
parent 64e0451dc6
commit 984004d07a
3 changed files with 7 additions and 7 deletions

View File

@ -4,7 +4,7 @@ fuse-navigation {
display: flex;
flex: 1 0 auto;
#main-navigation {
> .nav {
margin: 0;
padding: 0;
width: 100%;

View File

@ -72,7 +72,7 @@
<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">
<img class="flag mr-16" [src]="'assets/images/flags/'+lang.flag+'.png'">
<span class="iso">{{lang.title}}</span>

View File

@ -160,14 +160,14 @@ export class ToolbarComponent implements OnInit, OnDestroy
/**
* Set the language
*
* @param langId
* @param lang
*/
setLanguage(langId): void
setLanguage(lang): void
{
// Set the selected language for toolbar
this.selectedLanguage = _.find(this.languages, {'id': langId});
// Set the selected language for the toolbar
this.selectedLanguage = lang;
// Use the selected language for translations
this._translateService.use(langId);
this._translateService.use(lang.id);
}
}