mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-04-27 02:23:10 +00:00
Lots of breaking changes, all "md" prefixes changed with "mat" due to angular material deprecation of "md", md2 package removed, its not compatible with latest material version, will be replaced with another date picker later.
96 lines
2.4 KiB
TypeScript
96 lines
2.4 KiB
TypeScript
import { Component } from '@angular/core';
|
|
import { NavigationEnd, NavigationStart, Router } from '@angular/router';
|
|
import { FuseConfigService } from '../../core/services/config.service';
|
|
|
|
@Component({
|
|
selector : 'fuse-toolbar',
|
|
templateUrl: './toolbar.component.html',
|
|
styleUrls : ['./toolbar.component.scss']
|
|
})
|
|
|
|
export class FuseToolbarComponent
|
|
{
|
|
userStatusOptions: any[];
|
|
languages: any;
|
|
selectedLanguage: any;
|
|
showLoadingBar: boolean;
|
|
horizontalNav: boolean;
|
|
|
|
constructor(
|
|
private router: Router,
|
|
private fuseConfig: FuseConfigService
|
|
)
|
|
{
|
|
this.userStatusOptions = [
|
|
{
|
|
'title': 'Online',
|
|
'icon' : 'icon-checkbox-marked-circle',
|
|
'color': '#4CAF50'
|
|
},
|
|
{
|
|
'title': 'Away',
|
|
'icon' : 'icon-clock',
|
|
'color': '#FFC107'
|
|
},
|
|
{
|
|
'title': 'Do not Disturb',
|
|
'icon' : 'icon-minus-circle',
|
|
'color': '#F44336'
|
|
},
|
|
{
|
|
'title': 'Invisible',
|
|
'icon' : 'icon-checkbox-blank-circle-outline',
|
|
'color': '#BDBDBD'
|
|
},
|
|
{
|
|
'title': 'Offline',
|
|
'icon' : 'icon-checkbox-blank-circle-outline',
|
|
'color': '#616161'
|
|
}
|
|
];
|
|
|
|
this.languages = [
|
|
{
|
|
'id' : 'en',
|
|
'title': 'English',
|
|
'flag' : 'us'
|
|
},
|
|
{
|
|
'id' : 'es',
|
|
'title': 'Spanish',
|
|
'flag' : 'es'
|
|
},
|
|
{
|
|
'id' : 'tr',
|
|
'title': 'Turkish',
|
|
'flag' : 'tr'
|
|
}
|
|
];
|
|
|
|
this.selectedLanguage = this.languages[0];
|
|
|
|
router.events.subscribe(
|
|
(event) => {
|
|
if ( event instanceof NavigationStart )
|
|
{
|
|
this.showLoadingBar = true;
|
|
}
|
|
if ( event instanceof NavigationEnd )
|
|
{
|
|
this.showLoadingBar = false;
|
|
}
|
|
});
|
|
|
|
this.fuseConfig.onSettingsChanged.subscribe((settings) => {
|
|
this.horizontalNav = settings.layout.navigation === 'top';
|
|
});
|
|
|
|
}
|
|
|
|
search(value)
|
|
{
|
|
// Do your search here...
|
|
console.log(value);
|
|
}
|
|
}
|